Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:25

0001 // Created on: 1993-06-14
0002 // Created by: Jean Yves LEBEY
0003 // Copyright (c) 1993-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 _TopOpeBRepBuild_HBuilder_HeaderFile
0018 #define _TopOpeBRepBuild_HBuilder_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TopOpeBRepBuild_Builder1.hxx>
0024 #include <TopTools_DataMapOfShapeInteger.hxx>
0025 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
0026 #include <TopoDS_Shape.hxx>
0027 #include <TColStd_ListOfInteger.hxx>
0028 #include <Standard_Transient.hxx>
0029 #include <TopAbs_State.hxx>
0030 #include <TopTools_ListOfShape.hxx>
0031 #include <Standard_Integer.hxx>
0032 class TopOpeBRepDS_BuildTool;
0033 class TopOpeBRepDS_HDataStructure;
0034 class TopOpeBRepBuild_Builder;
0035 
0036 
0037 class TopOpeBRepBuild_HBuilder;
0038 DEFINE_STANDARD_HANDLE(TopOpeBRepBuild_HBuilder, Standard_Transient)
0039 
0040 //! The HBuilder  algorithm    constructs   topological
0041 //! objects  from   an    existing  topology  and  new
0042 //! geometries attached to the topology. It is used to
0043 //! construct the result of a topological operation;
0044 //! the existing  topologies are the parts involved in
0045 //! the  topological  operation and the new geometries
0046 //! are the intersection lines and points.
0047 class TopOpeBRepBuild_HBuilder : public Standard_Transient
0048 {
0049 
0050 public:
0051 
0052   
0053   Standard_EXPORT TopOpeBRepBuild_HBuilder(const TopOpeBRepDS_BuildTool& BT);
0054   
0055   Standard_EXPORT const TopOpeBRepDS_BuildTool& BuildTool() const;
0056   
0057 
0058   //! Stores the data structure <HDS>,
0059   //! Create shapes from the new geometries described in <HDS>.
0060   Standard_EXPORT void Perform (const Handle(TopOpeBRepDS_HDataStructure)& HDS);
0061   
0062 
0063   //! Same as previous + evaluates if an operation performed on shapes S1,S2
0064   //! is a particular case.
0065   Standard_EXPORT void Perform (const Handle(TopOpeBRepDS_HDataStructure)& HDS, const TopoDS_Shape& S1, const TopoDS_Shape& S2);
0066   
0067   //! Removes all split and merge already performed.
0068   //! Does NOT clear the handled DS.
0069   Standard_EXPORT void Clear();
0070   
0071   //! returns the DS handled by this builder
0072   Standard_EXPORT Handle(TopOpeBRepDS_HDataStructure) DataStructure() const;
0073   
0074   Standard_EXPORT TopOpeBRepDS_BuildTool& ChangeBuildTool();
0075   
0076   //! Merges the two shapes <S1> and <S2> keeping the
0077   //! parts of states <TB1>,<TB2> in <S1>,<S2>.
0078   Standard_EXPORT void MergeShapes (const TopoDS_Shape& S1, const TopAbs_State TB1, const TopoDS_Shape& S2, const TopAbs_State TB2);
0079   
0080   //! Merges  the two solids <S1>   and <S2> keeping the
0081   //! parts in each solid of states <TB1> and <TB2>.
0082   Standard_EXPORT void MergeSolids (const TopoDS_Shape& S1, const TopAbs_State TB1, const TopoDS_Shape& S2, const TopAbs_State TB2);
0083   
0084   //! Merges the solid <S>  keeping the
0085   //! parts of state <TB>.
0086   Standard_EXPORT void MergeSolid (const TopoDS_Shape& S, const TopAbs_State TB);
0087   
0088 
0089   //! Returns True if the shape <S> has been split.
0090   Standard_EXPORT Standard_Boolean IsSplit (const TopoDS_Shape& S, const TopAbs_State ToBuild) const;
0091   
0092 
0093   //! Returns the split parts <ToBuild> of shape <S>.
0094   Standard_EXPORT const TopTools_ListOfShape& Splits (const TopoDS_Shape& S, const TopAbs_State ToBuild) const;
0095   
0096 
0097   //! Returns True if the shape <S> has been merged.
0098   Standard_EXPORT Standard_Boolean IsMerged (const TopoDS_Shape& S, const TopAbs_State ToBuild) const;
0099   
0100 
0101   //! Returns the merged parts <ToBuild> of shape <S>.
0102   Standard_EXPORT const TopTools_ListOfShape& Merged (const TopoDS_Shape& S, const TopAbs_State ToBuild) const;
0103   
0104 
0105   //! Returns the vertex created on point <I>.
0106   Standard_EXPORT const TopoDS_Shape& NewVertex (const Standard_Integer I) const;
0107   
0108 
0109   //! Returns the edges created on curve <I>.
0110   Standard_EXPORT const TopTools_ListOfShape& NewEdges (const Standard_Integer I) const;
0111   
0112 
0113   //! Returns the edges created on curve <I>.
0114   Standard_EXPORT TopTools_ListOfShape& ChangeNewEdges (const Standard_Integer I);
0115   
0116 
0117   //! Returns the faces created on surface <I>.
0118   Standard_EXPORT const TopTools_ListOfShape& NewFaces (const Standard_Integer I) const;
0119   
0120   Standard_EXPORT const TopTools_ListOfShape& Section();
0121   
0122   Standard_EXPORT void InitExtendedSectionDS (const Standard_Integer k = 3);
0123   
0124   Standard_EXPORT void InitSection (const Standard_Integer k = 3);
0125   
0126   Standard_EXPORT Standard_Boolean MoreSection() const;
0127   
0128   Standard_EXPORT void NextSection();
0129   
0130   Standard_EXPORT const TopoDS_Shape& CurrentSection() const;
0131   
0132   Standard_EXPORT Standard_Integer GetDSEdgeFromSectEdge (const TopoDS_Shape& E, const Standard_Integer rank);
0133   
0134   Standard_EXPORT TColStd_ListOfInteger& GetDSFaceFromDSEdge (const Standard_Integer indexEdg, const Standard_Integer rank);
0135   
0136   Standard_EXPORT Standard_Integer GetDSCurveFromSectEdge (const TopoDS_Shape& SectEdge);
0137   
0138   Standard_EXPORT Standard_Integer GetDSFaceFromDSCurve (const Standard_Integer indexCur, const Standard_Integer rank);
0139   
0140   Standard_EXPORT Standard_Integer GetDSPointFromNewVertex (const TopoDS_Shape& NewVert);
0141   
0142   //! search for the couple of face F1,F2
0143   //! (from arguments of supra Perform(S1,S2,HDS)) method which
0144   //! intersection gives section edge E built on an intersection curve.
0145   //! returns True if F1,F2 have been valued.
0146   //! returns False if E is not a section edge built
0147   //! on intersection curve IC.
0148   Standard_EXPORT Standard_Boolean EdgeCurveAncestors (const TopoDS_Shape& E, TopoDS_Shape& F1, TopoDS_Shape& F2, Standard_Integer& IC);
0149   
0150   //! search for the couple of face F1,F2
0151   //! (from arguments of supra Perform(S1,S2,HDS)) method which
0152   //! intersection gives section edge E built on at least one edge .
0153   //! returns True if F1,F2 have been valued.
0154   //! returns False if E is not a section edge built
0155   //! on at least one edge of S1 and/or S2.
0156   //! LE1,LE2 are edges of S1,S2 which common part is edge E.
0157   //! LE1 or LE2 may be empty() but not both.
0158   Standard_EXPORT Standard_Boolean EdgeSectionAncestors (const TopoDS_Shape& E, TopTools_ListOfShape& LF1, TopTools_ListOfShape& LF2, TopTools_ListOfShape& LE1, TopTools_ListOfShape& LE2);
0159   
0160   //! Returns 0 is standard operation, != 0 if particular case
0161   Standard_EXPORT Standard_Integer IsKPart();
0162   
0163   Standard_EXPORT void MergeKPart (const TopAbs_State TB1, const TopAbs_State TB2);
0164   
0165   Standard_EXPORT TopOpeBRepBuild_Builder& ChangeBuilder();
0166 
0167 
0168 
0169 
0170   DEFINE_STANDARD_RTTIEXT(TopOpeBRepBuild_HBuilder,Standard_Transient)
0171 
0172 protected:
0173 
0174 
0175   TopOpeBRepBuild_Builder1 myBuilder;
0176 
0177 
0178 private:
0179 
0180   
0181   Standard_EXPORT void MakeEdgeAncestorMap();
0182   
0183   Standard_EXPORT void MakeCurveAncestorMap();
0184 
0185   TopTools_DataMapOfShapeInteger mySectEdgeDSEdges1;
0186   TopTools_DataMapOfShapeInteger mySectEdgeDSEdges2;
0187   TColStd_DataMapOfIntegerListOfInteger myDSEdgesDSFaces1;
0188   TColStd_DataMapOfIntegerListOfInteger myDSEdgesDSFaces2;
0189   Standard_Boolean myMakeEdgeAncestorIsDone;
0190   TopTools_DataMapOfShapeInteger mySectEdgeDSCurve;
0191   Standard_Boolean myMakeCurveAncestorIsDone;
0192   TopTools_DataMapOfShapeInteger myNewVertexDSPoint;
0193   Standard_Boolean myMakePointAncestorIsDone;
0194   TopoDS_Shape myEmptyShape;
0195   TColStd_ListOfInteger myEmptyIntegerList;
0196 
0197 
0198 };
0199 
0200 
0201 
0202 
0203 
0204 
0205 
0206 #endif // _TopOpeBRepBuild_HBuilder_HeaderFile