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 MESHVIZXLM_DMAP_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
00077 static bool getEnhancedColoring( SoState* state );
00078
00080 static bool getDefault(MoMaterial::ColoringType& coloring, SbColor& color,
00081 MoMaterial::ColoringType& lineColoring, SbColor& lineColor,
00082 MoMaterial::ColoringType& markerColoring, SbColor& markerColor,
00083 float& transparency, bool& enhancedColoring);
00084
00088 virtual void print(FILE *fp) const;
00089
00090 private:
00091
00093 virtual void init(SoState *state);
00094
00098 virtual SbBool matches(const SoElement* elt) const;
00099
00103 virtual SoElement* copyMatchInfo() const;
00104
00105 private:
00106
00107 static void initClass();
00108 static void exitClass() ;
00109
00110 private:
00111 MoMaterial::ColoringType m_coloring;
00112 SbColor m_color;
00113 MoMaterial::ColoringType m_lineColoring;
00114 SbColor m_lineColor;
00115 MoMaterial::ColoringType m_markerColoring;
00116 SbColor m_markerColor;
00117 float m_transparency;
00118 bool m_enhancedColoring;
00119 bool m_isSet;
00120
00121 virtual ~MoMaterialElement();
00122
00123 };
00124
00125
00126 #endif // _MO_MATERIAL_ELEMENT_
00127
00128
00129