Changeset 13041 for OpenSceneGraph/trunk/src/osgPlugins/dxf/scene.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/dxf/scene.cpp
r12171 r13041 11 11 12 12 13 osg::Vec4 13 osg::Vec4 14 14 sceneLayer::getColor(unsigned short color) 15 15 { … … 24 24 25 25 scene::scene(dxfLayerTable* lt) : _layerTable(lt) 26 { 27 _m.makeIdentity(); 28 _r.makeIdentity(); 29 } 30 31 void 26 { 27 _m.makeIdentity(); 28 _r.makeIdentity(); 29 } 30 31 void 32 32 scene::setLayerTable(dxfLayerTable* lt) 33 { 34 _layerTable = lt; 35 } 36 37 Vec3d scene::addVertex(Vec3d v) 33 { 34 _layerTable = lt; 35 } 36 37 Vec3d scene::addVertex(Vec3d v) 38 38 { 39 39 v += _t; … … 46 46 } 47 47 48 Vec3d scene::addNormal(Vec3d v) 48 Vec3d scene::addNormal(Vec3d v) 49 49 { 50 50 // to do: vertices are not always listed in order. find why. 51 51 return v; 52 52 } 53 void 54 scene::addPoint(const std::string & l, unsigned short color, Vec3d & s) 53 void 54 scene::addPoint(const std::string & l, unsigned short color, Vec3d & s) 55 55 { 56 56 dxfLayer* layer = _layerTable->findOrCreateLayer(l); … … 58 58 sceneLayer* ly = findOrCreateSceneLayer(l); 59 59 Vec3d a(addVertex(s)); 60 ly->_points[correctedColorIndex(l, color)].push_back(a); 61 } 62 63 void 64 scene::addLine(const std::string & l, unsigned short color, Vec3d & s, Vec3d & e) 60 ly->_points[correctedColorIndex(l, color)].push_back(a); 61 } 62 63 void 64 scene::addLine(const std::string & l, unsigned short color, Vec3d & s, Vec3d & e) 65 65 { 66 66 dxfLayer* layer = _layerTable->findOrCreateLayer(l); … … 71 71 ly->_lines[correctedColorIndex(l, color)].push_back(b); 72 72 } 73 void scene::addLineStrip(const std::string & l, unsigned short color, std::vector<Vec3d> & vertices) 73 void scene::addLineStrip(const std::string & l, unsigned short color, std::vector<Vec3d> & vertices) 74 74 { 75 75 dxfLayer* layer = _layerTable->findOrCreateLayer(l); … … 83 83 ly->_linestrips[correctedColorIndex(l, color)].push_back(converted); 84 84 } 85 void scene::addLineLoop(const std::string & l, unsigned short color, std::vector<Vec3d> & vertices) 85 void scene::addLineLoop(const std::string & l, unsigned short color, std::vector<Vec3d> & vertices) 86 86 { 87 87 dxfLayer* layer = _layerTable->findOrCreateLayer(l); … … 98 98 99 99 100 void scene::addTriangles(const std::string & l, unsigned short color, std::vector<Vec3d> & vertices, bool inverted) 100 void scene::addTriangles(const std::string & l, unsigned short color, std::vector<Vec3d> & vertices, bool inverted) 101 101 { 102 102 dxfLayer* layer = _layerTable->findOrCreateLayer(l); … … 116 116 b = itr++; 117 117 c = itr++; 118 } 118 } 119 119 if (a != vertices.end() && 120 120 b != vertices.end() && … … 129 129 } 130 130 } 131 void scene::addQuads(const std::string & l, unsigned short color, std::vector<Vec3d> & vertices, bool inverted) 132 { 133 dxfLayer* layer = _layerTable->findOrCreateLayer(l); 134 if (layer->getFrozen()) return; 135 131 void scene::addQuads(const std::string & l, unsigned short color, std::vector<Vec3d> & vertices, bool inverted) 132 { 133 dxfLayer* layer = _layerTable->findOrCreateLayer(l); 134 if (layer->getFrozen()) return; 135 136 136 sceneLayer* ly = findOrCreateSceneLayer(l); 137 137 for (VList::iterator itr = vertices.begin(); … … 173 173 } 174 174 } 175 } 176 177 178 void scene::addText(const std::string & l, unsigned short color, Vec3d & point, osgText::Text *text) 175 } 176 177 178 void scene::addText(const std::string & l, unsigned short color, Vec3d & point, osgText::Text *text) 179 179 { 180 180 dxfLayer* layer = _layerTable->findOrCreateLayer(l); … … 194 194 qm.decompose( t, ro, s, so ); 195 195 text->setRotation( text->getRotation() * ro ); 196 196 197 197 sceneLayer::textInfo ti( correctedColorIndex(l,color), pscene, text ); 198 198 ly->_textList.push_back(ti); … … 200 200 201 201 202 unsigned short 202 unsigned short 203 203 scene::correctedColorIndex(const std::string & l, unsigned short color) 204 204 {
