Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-29 09:20:43

0001 // Created on: 1991-02-21
0002 // Created by: Remi Lequette
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 _TopoDS_Builder_HeaderFile
0018 #define _TopoDS_Builder_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 class TopoDS_Shape;
0025 class TopoDS_TShape;
0026 class TopoDS_Wire;
0027 class TopoDS_Shell;
0028 class TopoDS_Solid;
0029 class TopoDS_CompSolid;
0030 class TopoDS_Compound;
0031 
0032 //! A Builder is used to create Topological Data Structures.
0033 //! It is the root of the Builder class hierarchy.
0034 //!
0035 //! There are three groups of methods in the Builder:
0036 //!
0037 //! The Make methods create Shapes.
0038 //!
0039 //! The Add method includes a Shape in another Shape.
0040 //!
0041 //! The Remove method removes a Shape from an other
0042 //! Shape.
0043 //!
0044 //! The methods in Builder are not static. They can be
0045 //! redefined in inherited builders.
0046 //!
0047 //! This Builder does not provide methods to Make
0048 //! Vertices, Edges, Faces, Shells or Solids. These
0049 //! methods are provided in the inherited Builders
0050 //! as they must provide the geometry.
0051 //!
0052 //! The Add method check for the following rules:
0053 //!
0054 //! - Any SHAPE can be added in a COMPOUND.
0055 //!
0056 //! - Only SOLID can be added in a COMPSOLID.
0057 //!
0058 //! - Only SHELL, EDGE and VERTEX can be added in a SOLID.
0059 //! EDGE and VERTEX as to be INTERNAL or EXTERNAL.
0060 //!
0061 //! - Only FACE can be added in a SHELL.
0062 //!
0063 //! - Only WIRE and VERTEX can be added in a FACE.
0064 //! VERTEX as to be INTERNAL or EXTERNAL.
0065 //!
0066 //! - Only EDGE can be added in a WIRE.
0067 //!
0068 //! - Only VERTEX can be added in an EDGE.
0069 //!
0070 //! - Nothing can be added in a VERTEX.
0071 class TopoDS_Builder
0072 {
0073 public:
0074   DEFINE_STANDARD_ALLOC
0075 
0076   //! Make an empty Wire.
0077   void MakeWire(TopoDS_Wire& W) const;
0078 
0079   //! Make an empty Shell.
0080   void MakeShell(TopoDS_Shell& S) const;
0081 
0082   //! Make a Solid covering the whole 3D space.
0083   void MakeSolid(TopoDS_Solid& S) const;
0084 
0085   //! Make an empty Composite Solid.
0086   void MakeCompSolid(TopoDS_CompSolid& C) const;
0087 
0088   //! Make an empty Compound.
0089   void MakeCompound(TopoDS_Compound& C) const;
0090 
0091   //! Add the Shape C in the Shape S.
0092   //! Exceptions
0093   //! - TopoDS_FrozenShape if S is not free and cannot be modified.
0094   //! - TopoDS__UnCompatibleShapes if S and C are not compatible.
0095   Standard_EXPORT void Add(TopoDS_Shape& S, const TopoDS_Shape& C) const;
0096 
0097   //! Remove the Shape C from the Shape S.
0098   //! Exceptions
0099   //! TopoDS_FrozenShape if S is frozen and cannot be modified.
0100   Standard_EXPORT void Remove(TopoDS_Shape& S, const TopoDS_Shape& C) const;
0101 
0102 protected:
0103   //! The basic method to make a Shape, used by all the
0104   //! Make methods.
0105   Standard_EXPORT void MakeShape(TopoDS_Shape& S, const occ::handle<TopoDS_TShape>& T) const;
0106 };
0107 
0108 #include <TopoDS_Builder.lxx>
0109 
0110 #endif // _TopoDS_Builder_HeaderFile