Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:16

0001 // Created on: 1991-09-18
0002 // Created by: Christophe MARION
0003 // Copyright (c) 1991-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 _BRepPrim_GWedge_HeaderFile
0018 #define _BRepPrim_GWedge_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRepPrim_Builder.hxx>
0025 #include <gp_Ax2.hxx>
0026 #include <TopoDS_Shell.hxx>
0027 #include <Standard_Boolean.hxx>
0028 #include <TopoDS_Vertex.hxx>
0029 #include <TopoDS_Edge.hxx>
0030 #include <TopoDS_Wire.hxx>
0031 #include <TopoDS_Face.hxx>
0032 #include <BRepPrim_Direction.hxx>
0033 class gp_Pln;
0034 class gp_Lin;
0035 class gp_Pnt;
0036 
0037 
0038 //! A wedge is defined by  :
0039 //!
0040 //! Axes : an Axis2 (coordinate system)
0041 //!
0042 //! YMin, YMax the  coordinates of the  ymin and ymax
0043 //! rectangular faces parallel to the ZX plane (of the
0044 //! coordinate systems)
0045 //!
0046 //! ZMin,ZMax,XMin,XMax the rectangular
0047 //! left (YMin) face parallel to the Z and X axes.
0048 //!
0049 //! Z2Min,Z2Max,X2Min,X2Max the rectangular
0050 //! right (YMax) face parallel to the Z and X axes.
0051 //!
0052 //! For a box Z2Min = ZMin, Z2Max = ZMax,
0053 //! X2Min = XMin, X2Max = XMax
0054 //!
0055 //! The wedge can be open in the corresponding direction
0056 //! of its Boolean myInfinite
0057 class BRepPrim_GWedge 
0058 {
0059 public:
0060 
0061   DEFINE_STANDARD_ALLOC
0062 
0063   //! Default constructor
0064   Standard_EXPORT BRepPrim_GWedge();
0065   
0066   //! Creates a  GWedge  algorithm.   <Axes> is  the axis
0067   //! system for the primitive.
0068   //!
0069   //! XMin, YMin, ZMin are set to 0
0070   //! XMax, YMax, ZMax are set to dx, dy, dz
0071   //! Z2Min = ZMin
0072   //! Z2Max = ZMax
0073   //! X2Min = XMin
0074   //! X2Max = XMax
0075   //! The result is a box
0076   //! dx,dy,dz should be positive
0077   Standard_EXPORT BRepPrim_GWedge(const BRepPrim_Builder& B, const gp_Ax2& Axes, const Standard_Real dx, const Standard_Real dy, const Standard_Real dz);
0078   
0079   //! Creates  a GWedge  primitive. <Axes> is   the  axis
0080   //! system for the primitive.
0081   //!
0082   //! XMin, YMin, ZMin are set to 0
0083   //! XMax, YMax, ZMax are set to dx, dy, dz
0084   //! Z2Min = ZMin
0085   //! Z2Max = ZMax
0086   //! X2Min = ltx
0087   //! X2Max = ltx
0088   //! The result is a STEP right angular wedge
0089   //! dx,dy,dz should be positive
0090   //! ltx should not be negative
0091   Standard_EXPORT BRepPrim_GWedge(const BRepPrim_Builder& B, const gp_Ax2& Axes, const Standard_Real dx, const Standard_Real dy, const Standard_Real dz, const Standard_Real ltx);
0092   
0093   //! Create  a GWedge primitive.   <Axes>  is  the  axis
0094   //! system for the primitive.
0095   //!
0096   //! all the fields are set to the corresponding value
0097   //! XYZMax - XYZMin should be positive
0098   //! ZX2Max - ZX2Min should not be negative
0099   Standard_EXPORT BRepPrim_GWedge(const BRepPrim_Builder& B, const gp_Ax2& Axes, const Standard_Real xmin, const Standard_Real ymin, const Standard_Real zmin, const Standard_Real z2min, const Standard_Real x2min, const Standard_Real xmax, const Standard_Real ymax, const Standard_Real zmax, const Standard_Real z2max, const Standard_Real x2max);
0100   
0101   //! Returns the coordinates system from <me>.
0102   Standard_EXPORT gp_Ax2 Axes() const;
0103   
0104   //! Returns Xmin value from <me>.
0105   Standard_EXPORT Standard_Real GetXMin() const;
0106   
0107   //! Returns YMin value from <me>.
0108   Standard_EXPORT Standard_Real GetYMin() const;
0109   
0110   //! Returns ZMin value from <me>.
0111   Standard_EXPORT Standard_Real GetZMin() const;
0112   
0113   //! Returns Z2Min value from <me>.
0114   Standard_EXPORT Standard_Real GetZ2Min() const;
0115   
0116   //! Returns X2Min value from <me>.
0117   Standard_EXPORT Standard_Real GetX2Min() const;
0118   
0119   //! Returns XMax value from <me>.
0120   Standard_EXPORT Standard_Real GetXMax() const;
0121   
0122   //! Returns YMax value from <me>.
0123   Standard_EXPORT Standard_Real GetYMax() const;
0124   
0125   //! Returns ZMax value from <me>.
0126   Standard_EXPORT Standard_Real GetZMax() const;
0127   
0128   //! Returns Z2Max value from <me>.
0129   Standard_EXPORT Standard_Real GetZ2Max() const;
0130   
0131   //! Returns X2Max value from <me>.
0132   Standard_EXPORT Standard_Real GetX2Max() const;
0133   
0134   //! Opens <me> in <d1> direction. A face and its edges
0135   //! or vertices are said nonexistant.
0136   Standard_EXPORT void Open (const BRepPrim_Direction d1);
0137   
0138   //! Closes   <me>  in <d1>  direction.  A face and its
0139   //! edges or vertices are said existant.
0140   Standard_EXPORT void Close (const BRepPrim_Direction d1);
0141   
0142   //! Returns True if <me> is open in <d1> direction.
0143   Standard_EXPORT Standard_Boolean IsInfinite (const BRepPrim_Direction d1) const;
0144   
0145   //! Returns the Shell containing the Faces of <me>.
0146   Standard_EXPORT const TopoDS_Shell& Shell();
0147   
0148   //! Returns True if <me> has a Face in <d1> direction.
0149   Standard_EXPORT Standard_Boolean HasFace (const BRepPrim_Direction d1) const;
0150   
0151   //! Returns the Face of <me> located in <d1> direction.
0152   Standard_EXPORT const TopoDS_Face& Face (const BRepPrim_Direction d1);
0153   
0154   //! Returns the plane  of the Face  of <me> located in
0155   //! <d1> direction.
0156   Standard_EXPORT gp_Pln Plane (const BRepPrim_Direction d1);
0157   
0158   //! Returns True if <me> has a Wire in <d1> direction.
0159   Standard_EXPORT Standard_Boolean HasWire (const BRepPrim_Direction d1) const;
0160   
0161   //! Returns the Wire of <me> located in <d1> direction.
0162   Standard_EXPORT const TopoDS_Wire& Wire (const BRepPrim_Direction d1);
0163   
0164   //! Returns True if <me> has an Edge in <d1><d2> direction.
0165   Standard_EXPORT Standard_Boolean HasEdge (const BRepPrim_Direction d1, const BRepPrim_Direction d2) const;
0166   
0167   //! Returns the Edge of <me> located in <d1><d2> direction.
0168   Standard_EXPORT const TopoDS_Edge& Edge (const BRepPrim_Direction d1, const BRepPrim_Direction d2);
0169   
0170   //! Returns the line of  the Edge of <me>  located  in
0171   //! <d1><d2> direction.
0172   Standard_EXPORT gp_Lin Line (const BRepPrim_Direction d1, const BRepPrim_Direction d2);
0173   
0174   //! Returns True if <me> has a  Vertex in <d1><d2><d3>
0175   //! direction.
0176   Standard_EXPORT Standard_Boolean HasVertex (const BRepPrim_Direction d1, const BRepPrim_Direction d2, const BRepPrim_Direction d3) const;
0177   
0178   //! Returns the Vertex of <me> located in <d1><d2><d3>
0179   //! direction.
0180   Standard_EXPORT const TopoDS_Vertex& Vertex (const BRepPrim_Direction d1, const BRepPrim_Direction d2, const BRepPrim_Direction d3);
0181   
0182   //! Returns the point of the Vertex of <me> located in
0183   //! <d1><d2><d3> direction.
0184   Standard_EXPORT gp_Pnt Point (const BRepPrim_Direction d1, const BRepPrim_Direction d2, const BRepPrim_Direction d3);
0185 
0186   //! Checks a shape on degeneracy
0187   //! @return TRUE if a shape is degenerated
0188   Standard_EXPORT Standard_Boolean IsDegeneratedShape();
0189 
0190 
0191 protected:
0192 
0193 
0194 
0195 
0196 
0197 private:
0198 
0199 
0200 
0201   BRepPrim_Builder myBuilder;
0202   gp_Ax2 myAxes;
0203   Standard_Real XMin;
0204   Standard_Real XMax;
0205   Standard_Real YMin;
0206   Standard_Real YMax;
0207   Standard_Real ZMin;
0208   Standard_Real ZMax;
0209   Standard_Real Z2Min;
0210   Standard_Real Z2Max;
0211   Standard_Real X2Min;
0212   Standard_Real X2Max;
0213   TopoDS_Shell myShell;
0214   Standard_Boolean ShellBuilt;
0215   TopoDS_Vertex myVertices[8];
0216   Standard_Boolean VerticesBuilt[8];
0217   TopoDS_Edge myEdges[12];
0218   Standard_Boolean EdgesBuilt[12];
0219   TopoDS_Wire myWires[6];
0220   Standard_Boolean WiresBuilt[6];
0221   TopoDS_Face myFaces[6];
0222   Standard_Boolean FacesBuilt[6];
0223   Standard_Boolean myInfinite[6];
0224 
0225 
0226 };
0227 
0228 
0229 
0230 
0231 
0232 
0233 
0234 #endif // _BRepPrim_GWedge_HeaderFile