File indexing completed on 2025-01-18 10:05:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _VrmlAPI_Writer_HeaderFile
0017 #define _VrmlAPI_Writer_HeaderFile
0018
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022
0023 #include <VrmlAPI_RepresentationOfShape.hxx>
0024 #include <Quantity_HArray1OfColor.hxx>
0025 #include <Standard_Integer.hxx>
0026
0027 class VrmlConverter_Drawer;
0028 class VrmlConverter_Projector;
0029 class Vrml_Material;
0030 class TopoDS_Shape;
0031 class TDocStd_Document;
0032
0033
0034
0035
0036
0037 class VrmlAPI_Writer
0038 {
0039 public:
0040
0041 DEFINE_STANDARD_ALLOC
0042
0043
0044
0045 Standard_EXPORT VrmlAPI_Writer();
0046
0047
0048
0049 Standard_EXPORT void ResetToDefaults();
0050
0051
0052 Standard_EXPORT Handle(VrmlConverter_Drawer) Drawer() const;
0053
0054
0055
0056
0057
0058
0059
0060 Standard_EXPORT void SetDeflection (const Standard_Real aDef);
0061
0062
0063
0064
0065
0066
0067
0068 Standard_EXPORT void SetRepresentation (const VrmlAPI_RepresentationOfShape aRep);
0069
0070
0071 Standard_EXPORT void SetTransparencyToMaterial (Handle(Vrml_Material)& aMaterial, const Standard_Real aTransparency);
0072
0073 Standard_EXPORT void SetShininessToMaterial (Handle(Vrml_Material)& aMaterial, const Standard_Real aShininess);
0074
0075 Standard_EXPORT void SetAmbientColorToMaterial (Handle(Vrml_Material)& aMaterial, const Handle(Quantity_HArray1OfColor)& Color);
0076
0077 Standard_EXPORT void SetDiffuseColorToMaterial (Handle(Vrml_Material)& aMaterial, const Handle(Quantity_HArray1OfColor)& Color);
0078
0079 Standard_EXPORT void SetSpecularColorToMaterial (Handle(Vrml_Material)& aMaterial, const Handle(Quantity_HArray1OfColor)& Color);
0080
0081 Standard_EXPORT void SetEmissiveColorToMaterial (Handle(Vrml_Material)& aMaterial, const Handle(Quantity_HArray1OfColor)& Color);
0082
0083
0084
0085
0086 Standard_EXPORT VrmlAPI_RepresentationOfShape GetRepresentation() const;
0087
0088 Standard_EXPORT Handle(Vrml_Material) GetFrontMaterial() const;
0089
0090 Standard_EXPORT Handle(Vrml_Material) GetPointsMaterial() const;
0091
0092 Standard_EXPORT Handle(Vrml_Material) GetUisoMaterial() const;
0093
0094 Standard_EXPORT Handle(Vrml_Material) GetVisoMaterial() const;
0095
0096 Standard_EXPORT Handle(Vrml_Material) GetLineMaterial() const;
0097
0098 Standard_EXPORT Handle(Vrml_Material) GetWireMaterial() const;
0099
0100 Standard_EXPORT Handle(Vrml_Material) GetFreeBoundsMaterial() const;
0101
0102 Standard_EXPORT Handle(Vrml_Material) GetUnfreeBoundsMaterial() const;
0103
0104
0105
0106 Standard_EXPORT Standard_Boolean Write (const TopoDS_Shape& aShape, const Standard_CString aFile,
0107 const Standard_Integer aVersion = 2) const;
0108
0109
0110
0111 Standard_EXPORT Standard_Boolean WriteDoc(
0112 const Handle(TDocStd_Document) &theDoc,
0113 const Standard_CString theFile,
0114 const Standard_Real theScale) const;
0115
0116 protected:
0117
0118
0119
0120 Standard_EXPORT Standard_Boolean write_v1 (const TopoDS_Shape& aShape, const Standard_CString aFileName) const;
0121
0122
0123
0124 Standard_EXPORT Standard_Boolean write_v2 (const TopoDS_Shape& aShape, const Standard_CString aFileName) const;
0125
0126 private:
0127
0128 VrmlAPI_RepresentationOfShape myRepresentation;
0129 Handle(VrmlConverter_Drawer) myDrawer;
0130 Standard_Real myDeflection;
0131 Handle(VrmlConverter_Projector) myPerespectiveCamera;
0132 Handle(VrmlConverter_Projector) myOrthographicCamera;
0133 Standard_Real myTransparency;
0134 Standard_Real myShininess;
0135 Handle(Vrml_Material) myFrontMaterial;
0136 Handle(Vrml_Material) myPointsMaterial;
0137 Handle(Vrml_Material) myUisoMaterial;
0138 Handle(Vrml_Material) myVisoMaterial;
0139 Handle(Vrml_Material) myLineMaterial;
0140 Handle(Vrml_Material) myWireMaterial;
0141 Handle(Vrml_Material) myFreeBoundsMaterial;
0142 Handle(Vrml_Material) myUnfreeBoundsMaterial;
0143 Standard_Real DX;
0144 Standard_Real DY;
0145 Standard_Real DZ;
0146 Standard_Real XUp;
0147 Standard_Real YUp;
0148 Standard_Real ZUp;
0149 Standard_Real Focus;
0150
0151 };
0152
0153 #endif