Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:56

0001 // Created on: 1999-04-27
0002 // Created by: Andrey BETENEV
0003 // Copyright (c) 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 _ShapeFix_WireSegment_HeaderFile
0018 #define _ShapeFix_WireSegment_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopoDS_Vertex.hxx>
0025 #include <TopAbs_Orientation.hxx>
0026 #include <TColStd_HSequenceOfInteger.hxx>
0027 #include <Standard_Integer.hxx>
0028 class ShapeExtend_WireData;
0029 class TopoDS_Wire;
0030 class TopoDS_Edge;
0031 
0032 
0033 //! This class is auxiliary class (data storage) used in ComposeShell.
0034 //! It is intended for representing segment of the wire
0035 //! (or whole wire). The segment itself is represented by
0036 //! ShapeExtend_WireData. In addition, some associated data
0037 //! necessary for computations are stored:
0038 //!
0039 //! * Orientation flag - determines current use of the segment
0040 //! and used for parity checking:
0041 //!
0042 //! TopAbs_FORWARD and TopAbs_REVERSED - says that segment was
0043 //! traversed once in the corresponding direction, and hence
0044 //! it should be traversed once more in opposite direction;
0045 //!
0046 //! TopAbs_EXTERNAL - the segment was not yet traversed in any
0047 //! direction (i.e. not yet used as boundary)
0048 //!
0049 //! TopAbs_INTERNAL - the segment was traversed in both
0050 //! directions and hence is out of further work.
0051 //!
0052 //! Segments of initial bounding wires are created with
0053 //! orientation REVERSED (for outer wire) or FORWARD (for inner
0054 //! wires), and segments of splitting seams - with orientation
0055 //! EXTERNAL.
0056 class ShapeFix_WireSegment 
0057 {
0058 public:
0059 
0060   DEFINE_STANDARD_ALLOC
0061 
0062   
0063   //! Creates empty segment.
0064   Standard_EXPORT ShapeFix_WireSegment();
0065   
0066   //! Creates segment and initializes it with wire and orientation.
0067   Standard_EXPORT ShapeFix_WireSegment(const Handle(ShapeExtend_WireData)& wire, const TopAbs_Orientation ori = TopAbs_EXTERNAL);
0068   
0069   //! Creates segment and initializes it with wire and orientation.
0070   Standard_EXPORT ShapeFix_WireSegment(const TopoDS_Wire& wire, const TopAbs_Orientation ori = TopAbs_EXTERNAL);
0071   
0072   //! Clears all fields.
0073   Standard_EXPORT void Clear();
0074   
0075   //! Loads wire.
0076   Standard_EXPORT void Load (const Handle(ShapeExtend_WireData)& wire);
0077   
0078   //! Returns wire.
0079   Standard_EXPORT const Handle(ShapeExtend_WireData)& WireData() const;
0080   
0081   //! Sets orientation flag.
0082   Standard_EXPORT void Orientation (const TopAbs_Orientation ori);
0083   
0084   //! Returns orientation flag.
0085   Standard_EXPORT TopAbs_Orientation Orientation() const;
0086   
0087   //! Returns first vertex of the first edge in the wire
0088   //! (no dependance on Orientation()).
0089   Standard_EXPORT TopoDS_Vertex FirstVertex() const;
0090   
0091   //! Returns last vertex of the last edge in the wire
0092   //! (no dependance on Orientation()).
0093   Standard_EXPORT TopoDS_Vertex LastVertex() const;
0094   
0095   //! Returns True if FirstVertex() == LastVertex()
0096   Standard_EXPORT Standard_Boolean IsClosed() const;
0097   
0098   //! Returns Number of edges in the wire
0099   Standard_EXPORT Standard_Integer NbEdges() const;
0100   
0101   //! Returns edge by given index in the wire
0102   Standard_EXPORT TopoDS_Edge Edge (const Standard_Integer i) const;
0103   
0104   //! Replaces edge at index i by new one.
0105   Standard_EXPORT void SetEdge (const Standard_Integer i, const TopoDS_Edge& edge);
0106   
0107   //! Insert a new edge with index i and implicitly defined
0108   //! patch indices (indefinite patch).
0109   //! If i==0, edge is inserted at end of wire.
0110   Standard_EXPORT void AddEdge (const Standard_Integer i, const TopoDS_Edge& edge);
0111   
0112   //! Insert a new edge with index i and explicitly defined
0113   //! patch indices. If i==0, edge is inserted at end of wire.
0114   Standard_EXPORT void AddEdge (const Standard_Integer i, const TopoDS_Edge& edge, const Standard_Integer iumin, const Standard_Integer iumax, const Standard_Integer ivmin, const Standard_Integer ivmax);
0115   
0116   //! Set patch indices for edge i.
0117   Standard_EXPORT void SetPatchIndex (const Standard_Integer i, const Standard_Integer iumin, const Standard_Integer iumax, const Standard_Integer ivmin, const Standard_Integer ivmax);
0118   
0119   Standard_EXPORT void DefineIUMin (const Standard_Integer i, const Standard_Integer iumin);
0120   
0121   Standard_EXPORT void DefineIUMax (const Standard_Integer i, const Standard_Integer iumax);
0122   
0123   Standard_EXPORT void DefineIVMin (const Standard_Integer i, const Standard_Integer ivmin);
0124   
0125   //! Modify minimal or maximal patch index for edge i.
0126   //! The corresponding patch index for that edge is modified so
0127   //! as to satisfy eq. iumin <= myIUMin(i) <= myIUMax(i) <= iumax
0128   Standard_EXPORT void DefineIVMax (const Standard_Integer i, const Standard_Integer ivmax);
0129   
0130   //! Returns patch indices for edge i.
0131   Standard_EXPORT void GetPatchIndex (const Standard_Integer i, Standard_Integer& iumin, Standard_Integer& iumax, Standard_Integer& ivmin, Standard_Integer& ivmax) const;
0132   
0133   //! Checks patch indices for edge i to satisfy equations
0134   //! IUMin(i) <= IUMax(i) <= IUMin(i)+1
0135   Standard_EXPORT Standard_Boolean CheckPatchIndex (const Standard_Integer i) const;
0136   
0137   Standard_EXPORT void SetVertex (const TopoDS_Vertex& theVertex);
0138   
0139   Standard_EXPORT TopoDS_Vertex GetVertex() const;
0140   
0141   Standard_EXPORT Standard_Boolean IsVertex() const;
0142 
0143 
0144 
0145 
0146 protected:
0147 
0148 
0149 
0150 
0151 
0152 private:
0153 
0154 
0155 
0156   Handle(ShapeExtend_WireData) myWire;
0157   TopoDS_Vertex myVertex;
0158   TopAbs_Orientation myOrient;
0159   Handle(TColStd_HSequenceOfInteger) myIUMin;
0160   Handle(TColStd_HSequenceOfInteger) myIUMax;
0161   Handle(TColStd_HSequenceOfInteger) myIVMin;
0162   Handle(TColStd_HSequenceOfInteger) myIVMax;
0163 
0164 
0165 };
0166 
0167 
0168 
0169 
0170 
0171 
0172 
0173 #endif // _ShapeFix_WireSegment_HeaderFile