Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/opencascade/BRep_Builder.lxx is written in an unsupported language. File is not indexed.

0001 // Created on: 1991-07-02
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 #include <TopoDS_Face.hxx>
0018 #include <TopoDS_Vertex.hxx>
0019 #include <BRep_TFace.hxx>
0020 #include <BRep_TVertex.hxx>
0021 #include <BRep_Tool.hxx>
0022 
0023 //=======================================================================
0024 // function : MakeFace
0025 // purpose  :
0026 //=======================================================================
0027 
0028 inline void BRep_Builder::MakeFace(TopoDS_Face& F) const
0029 {
0030   Handle(BRep_TFace) TF = new BRep_TFace();
0031   MakeShape(F, TF);
0032 }
0033 
0034 //=======================================================================
0035 // function : MakeEdge
0036 // purpose  : make edge from curve
0037 //=======================================================================
0038 
0039 inline void BRep_Builder::MakeEdge(TopoDS_Edge&              E,
0040                                    const Handle(Geom_Curve)& C,
0041                                    const Standard_Real       Tol) const
0042 {
0043   MakeEdge(E);
0044   UpdateEdge(E, C, TopLoc_Location(), Tol);
0045 }
0046 
0047 //=======================================================================
0048 // function : MakeEdge
0049 // purpose  : make edge from curve
0050 //=======================================================================
0051 
0052 inline void BRep_Builder::MakeEdge(TopoDS_Edge& E, const Handle(Poly_Polygon3D)& P) const
0053 {
0054   MakeEdge(E);
0055   UpdateEdge(E, P);
0056 }
0057 
0058 //=======================================================================
0059 // function : MakeEdge
0060 // purpose  : make edge from triangulation
0061 //=======================================================================
0062 
0063 inline void BRep_Builder::MakeEdge(TopoDS_Edge&                               E,
0064                                    const Handle(Poly_PolygonOnTriangulation)& P,
0065                                    const Handle(Poly_Triangulation)&          T) const
0066 {
0067   MakeEdge(E);
0068   UpdateEdge(E, P, T, TopLoc_Location());
0069 }
0070 
0071 //=======================================================================
0072 // function : MakeEdge
0073 // purpose  : make edge from triangulation
0074 //=======================================================================
0075 
0076 inline void BRep_Builder::MakeEdge(TopoDS_Edge&                               E,
0077                                    const Handle(Poly_PolygonOnTriangulation)& P,
0078                                    const Handle(Poly_Triangulation)&          T,
0079                                    const TopLoc_Location&                     L) const
0080 {
0081   MakeEdge(E);
0082   UpdateEdge(E, P, T, L);
0083 }
0084 
0085 //=======================================================================
0086 // function : MakeEdge
0087 // purpose  : make edge from curve
0088 //=======================================================================
0089 
0090 inline void BRep_Builder::MakeEdge(TopoDS_Edge&              E,
0091                                    const Handle(Geom_Curve)& C,
0092                                    const TopLoc_Location&    L,
0093                                    const Standard_Real       Tol) const
0094 {
0095   MakeEdge(E);
0096   UpdateEdge(E, C, L, Tol);
0097 }
0098 
0099 //=======================================================================
0100 // function : UpdateEdge
0101 // purpose  :
0102 //=======================================================================
0103 
0104 inline void BRep_Builder::UpdateEdge(const TopoDS_Edge&        E,
0105                                      const Handle(Geom_Curve)& C,
0106                                      const Standard_Real       Tol) const
0107 {
0108   UpdateEdge(E, C, TopLoc_Location(), Tol);
0109 }
0110 
0111 //=======================================================================
0112 // function : UpdateEdge
0113 // purpose  :
0114 //=======================================================================
0115 
0116 inline void BRep_Builder::UpdateEdge(const TopoDS_Edge&          E,
0117                                      const Handle(Geom2d_Curve)& C,
0118                                      const TopoDS_Face&          F,
0119                                      const Standard_Real         Tol) const
0120 {
0121   TopLoc_Location l;
0122   UpdateEdge(E, C, BRep_Tool::Surface(F, l), l, Tol);
0123 }
0124 
0125 //=======================================================================
0126 // function : UpdateEdge
0127 // purpose  :
0128 //=======================================================================
0129 
0130 inline void BRep_Builder::UpdateEdge(const TopoDS_Edge&          E,
0131                                      const Handle(Geom2d_Curve)& C1,
0132                                      const Handle(Geom2d_Curve)& C2,
0133                                      const TopoDS_Face&          F,
0134                                      const Standard_Real         Tol) const
0135 {
0136   TopLoc_Location l;
0137   UpdateEdge(E, C1, C2, BRep_Tool::Surface(F, l), l, Tol);
0138 }
0139 
0140 //=======================================================================
0141 // function : UpdateEdge
0142 // purpose  :
0143 //=======================================================================
0144 
0145 inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E, const Handle(Poly_Polygon3D)& P) const
0146 {
0147   UpdateEdge(E, P, TopLoc_Location());
0148 }
0149 
0150 //=======================================================================
0151 // function : UpdateEdge
0152 // purpose  :
0153 //=======================================================================
0154 
0155 inline void BRep_Builder::UpdateEdge(const TopoDS_Edge&                         E,
0156                                      const Handle(Poly_PolygonOnTriangulation)& P,
0157                                      const Handle(Poly_Triangulation)&          T) const
0158 {
0159   UpdateEdge(E, P, T, TopLoc_Location());
0160 }
0161 
0162 //=======================================================================
0163 // function : UpdateEdge
0164 // purpose  :
0165 //=======================================================================
0166 
0167 inline void BRep_Builder::UpdateEdge(const TopoDS_Edge&                         E,
0168                                      const Handle(Poly_PolygonOnTriangulation)& P1,
0169                                      const Handle(Poly_PolygonOnTriangulation)& P2,
0170                                      const Handle(Poly_Triangulation)&          T) const
0171 {
0172   UpdateEdge(E, P1, P2, T, TopLoc_Location());
0173 }
0174 
0175 //=======================================================================
0176 // function : Range
0177 // purpose  :
0178 //=======================================================================
0179 
0180 inline void BRep_Builder::Range(const TopoDS_Edge&  E,
0181                                 const TopoDS_Face&  F,
0182                                 const Standard_Real First,
0183                                 const Standard_Real Last) const
0184 {
0185   TopLoc_Location l;
0186   Range(E, BRep_Tool::Surface(F, l), l, First, Last);
0187 }
0188 
0189 //=======================================================================
0190 // function : MakeVertex
0191 // purpose  : undefined vertex
0192 //=======================================================================
0193 
0194 inline void BRep_Builder::MakeVertex(TopoDS_Vertex& V) const
0195 {
0196   Handle(BRep_TVertex) TV = new BRep_TVertex();
0197   MakeShape(V, TV);
0198 }
0199 
0200 //=======================================================================
0201 // function : MakeVertex
0202 // purpose  : vertex from 3d point
0203 //=======================================================================
0204 
0205 inline void BRep_Builder::MakeVertex(TopoDS_Vertex&      V,
0206                                      const gp_Pnt&       P,
0207                                      const Standard_Real Tol) const
0208 {
0209   MakeVertex(V);
0210   UpdateVertex(V, P, Tol);
0211 }
0212 
0213 //=======================================================================
0214 // function : UpdateVertex
0215 // purpose  : update vertex with parameter on edge on face
0216 //=======================================================================
0217 
0218 inline void BRep_Builder::UpdateVertex(const TopoDS_Vertex& V,
0219                                        const Standard_Real  Par,
0220                                        const TopoDS_Edge&   E,
0221                                        const TopoDS_Face&   F,
0222                                        const Standard_Real  Tol) const
0223 {
0224   TopLoc_Location l;
0225   UpdateVertex(V, Par, E, BRep_Tool::Surface(F, l), l, Tol);
0226 }