12#include <osg/Material>
16#include <osgText/Text>
39 void setTextureType(
const std::string &texture,
bool reflect) { textureType = texture; reflective = reflect; }
62 virtual void setSelected(
bool selected,
bool _selectionFromNavigationTree)
override;
66 void initializeFromFacetData(std::vector<Geometry::Node> &
nodes, std::list<Geometry::Triangle> &triangles, std::list<Geometry::Edge> &edges, std::map<ot::UID, std::string> &faceNameMap);
68 void updateObjectColor(
double surfaceColorRGB[3],
double edgeColorRGB[3],
const std::string &materialType,
const std::string &textureType,
bool reflective);
79 void setSurfaceColorRGB(
double color[3]) { surfaceColorRGB[0] = color[0]; surfaceColorRGB[1] = color[1]; surfaceColorRGB[2] = color[2]; };
80 void setEdgeColorRGB(
double color[3]) { edgeColorRGB[0] = color[0]; edgeColorRGB[1] = color[1]; edgeColorRGB[2] = color[2]; };
83 void setStorage(
const std::string &proj,
unsigned long long id,
unsigned long long version) { projectName = proj; entityID = id, entityVersion = version; };
96 osg::Node*
addSelectedEdge(
unsigned long long faceId1,
unsigned long long faceId2);
100 void deleteShapeNode(
void);
101 osg::Node *createOSGNodeFromTriangles(
double colorRGB[3],
const std::string &materialType,
const std::string &textureType,
bool reflective,
bool backFaceCulling,
double offsetFactor, std::vector<Geometry::Node> &
nodes, std::list<Geometry::Triangle> &triangles);
102 void createOSGNodeFromEdges(
double colorRGB[3], std::list<Geometry::Edge> &edges, osg::Node *&edgesNode, osg::Node *&edgesHighlightedNode, osg::Switch *&faceEdgesHighlightNode);
103 osg::Node *buildEdgesOSGNode(
unsigned long long nEdges, osg::Vec3Array *vertices,
double r,
double g,
double b,
double transp,
bool depthTest,
double width);
104 void assignTexture(osg::Geometry *geometry,
const std::string &textureType,
bool reflective,
double r,
double g,
double b);
105 void updateWireframeState(
bool visible,
bool wireframe,
bool transparent);
106 void setVisibleState(
bool visible,
bool transparent,
bool wireframe);
107 void updateTransparentState(
bool visible,
bool transparent,
bool wireframe);
108 void applyParentTransform(
void);
109 osg::Node* getEdgeHighlightNode(
unsigned long long faceId1,
unsigned long long faceId2,
double lineWidth);
111 osg::Node * triangles;
113 osg::Node * edgesHighlighted;
114 osg::Switch * faceEdgesHighlightNode;
115 osg::Node * highlightNode;
117 std::map<unsigned long long, osg::Node *> faceEdgesHighlight;
118 std::vector<unsigned long long> triangleToFaceId;
119 std::map<ot::UID, std::string> faceIdToNameMap;
120 std::vector<unsigned long long> edgeStartIndex;
121 std::vector<ot::UID> edgeFaceId;
123 double surfaceColorRGB[3];
124 double edgeColorRGB[3];
125 bool backFaceCulling;
127 std::string materialType;
128 std::string textureType;
130 bool showWhenSelected;
131 std::string projectName;
132 unsigned long long entityID;
133 unsigned long long entityVersion;
134 bool needsInitialization;
136 osg::StateAttribute *textureAttribute;
137 osg::TexGen *textureAttributeGen;
138 osg::TexEnv *textureAttributeEnv;
139 double edgeTranspacency;
140 osg::Matrix transformationMatrix;
@ nodes
Definition MonitorSettings.h:17
Mesh m
Definition SelfIntersectionCheck.cpp:26
@ e
Definition SourceTarget.h:4
@ h
Definition SourceTarget.h:4
The Model class is the main interface to the model. There may be multiple instances of this class....
Definition Model.h:94
Definition SceneNodeBase.h:14
Definition SceneNodeGeometry.h:29
osg::Node * addSelectedEdge(unsigned long long faceId1, unsigned long long faceId2)
Definition SceneNodeGeometry.cpp:1250
void setNeedsInitialization(void)
Definition SceneNodeGeometry.h:84
std::string getEdgeNameFromFaceIds(unsigned long long faceId1, unsigned long long faceId2)
Definition SceneNodeGeometry.cpp:728
void updateObjectFacetsFromDataBase(unsigned long long entityID, unsigned long long entityVersion)
Definition SceneNodeGeometry.cpp:1078
virtual void setHighlighted(bool h) override
Definition SceneNodeGeometry.cpp:368
virtual void setSelected(bool selected, bool _selectionFromNavigationTree) override
Definition SceneNodeGeometry.cpp:402
void setEdgeColorRGB(double color[3])
Definition SceneNodeGeometry.h:80
SceneNodeGeometry()
Definition SceneNodeGeometry.cpp:37
void setStorage(const std::string &proj, unsigned long long id, unsigned long long version)
Definition SceneNodeGeometry.h:83
void setBackFaceCulling(bool b)
Definition SceneNodeGeometry.h:81
virtual bool isItem3D(void)
Definition SceneNodeGeometry.h:94
std::string getProjectName(void)
Definition SceneNodeGeometry.h:86
void setSurfaceColorRGB(double color[3])
Definition SceneNodeGeometry.h:79
void setEdgeHighlightNode(unsigned long long faceId1, unsigned long long faceId2)
Definition SceneNodeGeometry.cpp:883
void setOffsetFactor(double o)
Definition SceneNodeGeometry.h:82
void applyTransform(osg::Matrix matrix)
Definition SceneNodeGeometry.cpp:435
osg::Node * getEdgesHighlighted(void)
Definition SceneNodeGeometry.h:53
virtual void setWireframe(bool w) override
Definition SceneNodeGeometry.cpp:252
void setTriangles(osg::Node *t)
Definition SceneNodeGeometry.h:34
osg::Node * getTriangles(void)
Definition SceneNodeGeometry.h:51
void setEdgeHighlight(unsigned long long faceId, bool h, double thickness)
Definition SceneNodeGeometry.cpp:385
void setTransformation(std::vector< double > &transformation)
Definition SceneNodeGeometry.cpp:97
void setHighlightNode(osg::Node *highlight)
Definition SceneNodeGeometry.cpp:1226
virtual bool isItem1D(void)
Definition SceneNodeGeometry.h:93
void setOwnTransformation(const osg::Matrix &matrix)
Definition SceneNodeGeometry.h:47
std::string getFaceNameFromId(unsigned long long faceId)
Definition SceneNodeGeometry.cpp:1214
osg::Matrix getTransformation(void)
Definition SceneNodeGeometry.cpp:121
osg::Matrix getOwnTransformation(void)
Definition SceneNodeGeometry.h:46
void setMaterialProperties(osg::ref_ptr< osg::Material > &mat, double r, double g, double b)
Definition SceneNodeGeometry.cpp:1153
virtual ~SceneNodeGeometry()
Definition SceneNodeGeometry.cpp:62
void removeSelectedEdge(osg::Node *selected)
Definition SceneNodeGeometry.cpp:1243
void initializeFromFacetData(std::vector< Geometry::Node > &nodes, std::list< Geometry::Triangle > &triangles, std::list< Geometry::Edge > &edges, std::map< ot::UID, std::string > &faceNameMap)
Definition SceneNodeGeometry.cpp:448
void setModel(Model *m)
Definition SceneNodeGeometry.h:91
Model * getModel(void)
Definition SceneNodeGeometry.h:90
void setEdges(osg::Node *e)
Definition SceneNodeGeometry.h:35
osg::Matrix getParentTransformation(void)
Definition SceneNodeGeometry.cpp:106
unsigned long long getFaceIdFromTriangleIndex(unsigned long long index)
Definition SceneNodeGeometry.h:72
osg::Node * getEdges(void)
Definition SceneNodeGeometry.h:52
virtual void setTransparent(bool t) override
Definition SceneNodeGeometry.cpp:136
void setEdgesHighlighted(osg::Node *e)
Definition SceneNodeGeometry.h:36
void setFaceEdgesHighlighted(osg::Switch *e)
Definition SceneNodeGeometry.h:37
void initializeFromDataStorage(void)
Definition SceneNodeGeometry.cpp:1094
ot::UID getFaceIdFromEdgePrimitiveIndex(unsigned long long hitIndex)
Definition SceneNodeGeometry.cpp:747
void updateObjectColor(double surfaceColorRGB[3], double edgeColorRGB[3], const std::string &materialType, const std::string &textureType, bool reflective)
Definition SceneNodeGeometry.cpp:1005
virtual void setVisible(bool v) override
Definition SceneNodeGeometry.cpp:325
void setShowWhenSelected(bool flag)
Definition SceneNodeGeometry.h:64
void setTextureType(const std::string &texture, bool reflect)
Definition SceneNodeGeometry.h:39
osg::Switch * getFaceEdgesHighlight(void)
Definition SceneNodeGeometry.h:54
void setMaterialType(const std::string &material)
Definition SceneNodeGeometry.h:38
Simple 3D viewer.
Definition Viewer.h:41
Definition RubberbandOsgWrapper.h:22
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27
Definition PHREECMeshExport.h:35