00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _MO_MATERIAL_ELEMENT_
00036 #define _MO_MATERIAL_ELEMENT_
00037
00038 #include <Inventor/elements/SoReplacedElement.h>
00039 #include <MeshVizXLM/mapping/MoMeshVizDataMapping.h>
00040 #include <MeshVizXLM/mapping/nodes/MoMaterial.h>
00041
00042 class MoDataBinding;
00043
00054 class MESHIVIZDM_API MoMaterialElement : public SoReplacedElement {
00055
00056 SO_ELEMENT_HEADER(MoMaterialElement);
00057
00058 public:
00059
00061 static void set(SoState *state, SoNode *node, MoMaterial::ColoringType coloring,const SbColor& color,
00062 MoMaterial::ColoringType lineColoring,const SbColor& lineColor,
00063 MoMaterial::ColoringType markerColoring, const SbColor& markerColor,
00064 float transparency, bool enhancedColoring);
00065
00067 static bool getMaterial(SoState *state, MoMaterial::ColoringType& coloring, SbColor& color,
00068 MoMaterial::ColoringType& lineColoring, SbColor& lineColor,
00069 MoMaterial::ColoringType& markerColoring, SbColor& markerColor,
00070 float& transparency, bool& enhancedColoring);
00071
00073 static bool getColoringTypes(SoState *state, MoMaterial::ColoringType& coloring,
00074 MoMaterial::ColoringType& lineColoring,
00075 MoMaterial::ColoringType& markerColoring);
00076
00078 static bool getDefault(MoMaterial::ColoringType& coloring, SbColor& color,
00079 MoMaterial::ColoringType& lineColoring, SbColor& lineColor,
00080 MoMaterial::ColoringType& markerColoring, SbColor& markerColor,
00081 float& transparency, bool& enhancedColoring);
00082
00086 virtual void print(FILE *fp) const;
00087
00088 private:
00089
00091 virtual void init(SoState *state);
00092
00096 virtual SbBool matches(const SoElement* elt) const;
00097
00101 virtual SoElement* copyMatchInfo() const;
00102
00103 private:
00104
00105 static void initClass();
00106 static void exitClass() ;
00107
00108 private:
00109 MoMaterial::ColoringType m_coloring;
00110 SbColor m_color;
00111 MoMaterial::ColoringType m_lineColoring;
00112 SbColor m_lineColor;
00113 MoMaterial::ColoringType m_markerColoring;
00114 SbColor m_markerColor;
00115 float m_transparency;
00116 bool m_enhancedColoring;
00117 bool m_isSet;
00118
00119 virtual ~MoMaterialElement();
00120
00121 };
00122
00123
00124 #endif // _MO_MATERIAL_ELEMENT_
00125
00126
00127