Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:27:28

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