Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-23 09:19:30

0001 // Created on: 1997-02-21
0002 // Created by: Alexander BRIVIN
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _VrmlConverter_Drawer_HeaderFile
0018 #define _VrmlConverter_Drawer_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <Aspect_TypeOfDeflection.hxx>
0025 #include <Standard_Transient.hxx>
0026 class VrmlConverter_IsoAspect;
0027 class VrmlConverter_LineAspect;
0028 class VrmlConverter_ShadingAspect;
0029 class VrmlConverter_PointAspect;
0030 
0031 //! qualifies the aspect properties for
0032 //! the VRML conversation of a specific kind of object.
0033 //! This includes for example color, maximal chordial deviation, etc...
0034 class VrmlConverter_Drawer : public Standard_Transient
0035 {
0036 
0037 public:
0038   Standard_EXPORT VrmlConverter_Drawer();
0039 
0040   //! by default: TOD_Relative; however, except for the shapes,
0041   //! the drawing will be made using the absolute deviation.
0042   Standard_EXPORT void SetTypeOfDeflection(const Aspect_TypeOfDeflection aTypeOfDeflection);
0043 
0044   Standard_EXPORT Aspect_TypeOfDeflection TypeOfDeflection() const;
0045 
0046   //! Defines the maximal chordial deviation when drawing any curve;
0047   //! If this value is one of the obvious parameters of methods,
0048   //! current value from Drawer won't be used.
0049   //! This value is used by:
0050   //!
0051   //! VrmlConverter_DeflectionCurve
0052   //! VrmlConverter_WFDeflectionRestrictedFace
0053   //! VrmlConverter_WFDeflectionShape
0054   Standard_EXPORT void SetMaximalChordialDeviation(const double aChordialDeviation);
0055 
0056   //! returns the maximal chordial deviation.
0057   //! Default value: 0.1
0058   Standard_EXPORT double MaximalChordialDeviation() const;
0059 
0060   //! default 0.001
0061   Standard_EXPORT void SetDeviationCoefficient(const double aCoefficient);
0062 
0063   Standard_EXPORT double DeviationCoefficient() const;
0064 
0065   //! default: 17 points.
0066   //! Defines the Discretisation (myNbPoints) when drawing any curve;
0067   //! If this value is one of the obvious parameters of methods,
0068   //! current value from Drawer won't be used.
0069   //! This value is used by:
0070   //!
0071   //! VrmlConverter_Curve
0072   //! VrmlConverter_WFRestrictedFace
0073   //! VrmlConverter_WFShape
0074   Standard_EXPORT void SetDiscretisation(const int d);
0075 
0076   Standard_EXPORT int Discretisation() const;
0077 
0078   //! defines the maximum value allowed for the first and last
0079   //! parameters of an infinite curve.
0080   //! Default value: 500.
0081   //! VrmlConverter_Curve
0082   //! VrmlConverter_WFRestrictedFace
0083   //! VrmlConverter_WFShape
0084   Standard_EXPORT void SetMaximalParameterValue(const double Value);
0085 
0086   Standard_EXPORT double MaximalParameterValue() const;
0087 
0088   //! enables the drawing of isos on planes.
0089   //! By default there are no isos on planes.
0090   Standard_EXPORT void SetIsoOnPlane(const bool OnOff);
0091 
0092   //! returns True if the drawing of isos on planes is enabled.
0093   Standard_EXPORT bool IsoOnPlane() const;
0094 
0095   //! Defines the attributes which are used when drawing an
0096   //! U isoparametric curve of a face. Defines the number
0097   //! of U isoparametric curves to be drawn for a single face.
0098   //! The default values are the same default values from Vrml package.
0099   //!
0100   //! These attributes are used by the following algorithms:
0101   //! VrmlConverter_WFRestrictedFace
0102   //! VrmlConverter_WFDeflectionRestrictedFace
0103   Standard_EXPORT occ::handle<VrmlConverter_IsoAspect> UIsoAspect();
0104 
0105   Standard_EXPORT void SetUIsoAspect(const occ::handle<VrmlConverter_IsoAspect>& anAspect);
0106 
0107   //! Defines the attributes which are used when drawing an
0108   //! V isoparametric curve of a face. Defines the number
0109   //! of V isoparametric curves to be drawn for a single face.
0110   //! The default values are the same default values from Vrml package.
0111   //!
0112   //! These attributes are used by the following algorithms:
0113   //! VrmlConverter_WFRestrictedFace
0114   //! VrmlConverter_WFDeflectionRestrictedFace
0115   Standard_EXPORT occ::handle<VrmlConverter_IsoAspect> VIsoAspect();
0116 
0117   Standard_EXPORT void SetVIsoAspect(const occ::handle<VrmlConverter_IsoAspect>& anAspect);
0118 
0119   //! The default values are the same default values from Vrml package.
0120   //! These attributes are used by the following algorithms:
0121   //! VrmlConverter_WFShape
0122   //! VrmlConverter_WFDeflectionShape
0123   Standard_EXPORT occ::handle<VrmlConverter_LineAspect> FreeBoundaryAspect();
0124 
0125   Standard_EXPORT void SetFreeBoundaryAspect(const occ::handle<VrmlConverter_LineAspect>& anAspect);
0126 
0127   //! enables the drawing the free boundaries
0128   //! By default the free boundaries are drawn.
0129   Standard_EXPORT void SetFreeBoundaryDraw(const bool OnOff);
0130 
0131   //! returns True if the drawing of the free boundaries is enabled.
0132   Standard_EXPORT bool FreeBoundaryDraw() const;
0133 
0134   //! The default values are the same default values from Vrml package.
0135   //! These attributes are used by the following algorithms:
0136   //! VrmlConverter_WFShape
0137   //! VrmlConverter_WFDeflectionShape
0138   Standard_EXPORT occ::handle<VrmlConverter_LineAspect> WireAspect();
0139 
0140   Standard_EXPORT void SetWireAspect(const occ::handle<VrmlConverter_LineAspect>& anAspect);
0141 
0142   //! enables the drawing the wire
0143   //! By default the wire are drawn.
0144   Standard_EXPORT void SetWireDraw(const bool OnOff);
0145 
0146   //! returns True if the drawing of the wire is enabled.
0147   Standard_EXPORT bool WireDraw() const;
0148 
0149   //! The default values are the same default values from Vrml package.
0150   //! These attributes are used by the following algorithms:
0151   //! VrmlConverter_WFShape
0152   //! VrmlConverter_WFDeflectionShape
0153   Standard_EXPORT occ::handle<VrmlConverter_LineAspect> UnFreeBoundaryAspect();
0154 
0155   Standard_EXPORT void SetUnFreeBoundaryAspect(
0156     const occ::handle<VrmlConverter_LineAspect>& anAspect);
0157 
0158   //! enables the drawing the unfree boundaries
0159   //! By default the unfree boundaries are drawn.
0160   Standard_EXPORT void SetUnFreeBoundaryDraw(const bool OnOff);
0161 
0162   //! returns True if the drawing of the unfree boundaries is enabled.
0163   Standard_EXPORT bool UnFreeBoundaryDraw() const;
0164 
0165   //! The default values are the same default values from Vrml package.
0166   Standard_EXPORT occ::handle<VrmlConverter_LineAspect> LineAspect();
0167 
0168   Standard_EXPORT void SetLineAspect(const occ::handle<VrmlConverter_LineAspect>& anAspect);
0169 
0170   Standard_EXPORT occ::handle<VrmlConverter_PointAspect> PointAspect();
0171 
0172   Standard_EXPORT void SetPointAspect(const occ::handle<VrmlConverter_PointAspect>& anAspect);
0173 
0174   //! The default values are the same default values from Vrml package.
0175   Standard_EXPORT occ::handle<VrmlConverter_ShadingAspect> ShadingAspect();
0176 
0177   Standard_EXPORT void SetShadingAspect(const occ::handle<VrmlConverter_ShadingAspect>& anAspect);
0178 
0179   //! returns true if the hidden lines are to be drawn.
0180   //! By default the hidden lines are not drawn.
0181   Standard_EXPORT bool DrawHiddenLine() const;
0182 
0183   //! sets DrawHiddenLine = true  - the hidden lines are drawn.
0184   Standard_EXPORT void EnableDrawHiddenLine();
0185 
0186   //! sets DrawHiddenLine = false - the hidden lines are not drawn.
0187   Standard_EXPORT void DisableDrawHiddenLine();
0188 
0189   //! returns LineAspect for the hidden lines.
0190   //! The default values are the same default values from Vrml package.
0191   Standard_EXPORT occ::handle<VrmlConverter_LineAspect> HiddenLineAspect();
0192 
0193   //! sets LineAspect for the hidden lines.
0194   Standard_EXPORT void SetHiddenLineAspect(const occ::handle<VrmlConverter_LineAspect>& anAspect);
0195 
0196   //! returns LineAspect for the seen lines.
0197   //! The default values are the same default values from Vrml package.
0198   Standard_EXPORT occ::handle<VrmlConverter_LineAspect> SeenLineAspect();
0199 
0200   //! sets LineAspect for the seen lines.
0201   Standard_EXPORT void SetSeenLineAspect(const occ::handle<VrmlConverter_LineAspect>& anAspect);
0202 
0203   DEFINE_STANDARD_RTTIEXT(VrmlConverter_Drawer, Standard_Transient)
0204 
0205 private:
0206   occ::handle<VrmlConverter_IsoAspect>     myUIsoAspect;
0207   occ::handle<VrmlConverter_IsoAspect>     myVIsoAspect;
0208   int                                      myNbPoints;
0209   bool                                     myIsoOnPlane;
0210   occ::handle<VrmlConverter_LineAspect>    myFreeBoundaryAspect;
0211   bool                                     myFreeBoundaryDraw;
0212   occ::handle<VrmlConverter_LineAspect>    myUnFreeBoundaryAspect;
0213   bool                                     myUnFreeBoundaryDraw;
0214   occ::handle<VrmlConverter_LineAspect>    myWireAspect;
0215   bool                                     myWireDraw;
0216   occ::handle<VrmlConverter_LineAspect>    myLineAspect;
0217   occ::handle<VrmlConverter_ShadingAspect> myShadingAspect;
0218   double                                   myChordialDeviation;
0219   Aspect_TypeOfDeflection                  myTypeOfDeflection;
0220   double                                   myMaximalParameterValue;
0221   double                                   myDeviationCoefficient;
0222   occ::handle<VrmlConverter_PointAspect>   myPointAspect;
0223   bool                                     myDrawHiddenLine;
0224   occ::handle<VrmlConverter_LineAspect>    myHiddenLineAspect;
0225   occ::handle<VrmlConverter_LineAspect>    mySeenLineAspect;
0226 };
0227 
0228 #endif // _VrmlConverter_Drawer_HeaderFile