Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:17:52

0001 // Created on: 1994-08-03
0002 // Created by: Christophe MARION
0003 // Copyright (c) 1994-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 _HLRBRep_Algo_HeaderFile
0018 #define _HLRBRep_Algo_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <HLRBRep_InternalAlgo.hxx>
0023 #include <Standard_Integer.hxx>
0024 class TopoDS_Shape;
0025 class Standard_Transient;
0026 
0027 //! Inherited from InternalAlgo to provide methods with Shape from TopoDS.
0028 //! A framework to compute a shape as seen in a projection plane. This is done by
0029 //! calculating the visible and the hidden parts of the shape.
0030 //! HLRBRep_Algo works with three types of entity:
0031 //! -   shapes to be visualized
0032 //! -   edges in these shapes (these edges are
0033 //! the basic entities which will be visualized or hidden), and
0034 //! -   faces in these shapes which hide the edges.
0035 //! HLRBRep_Algo is based on the principle of comparing each edge of the shape to be
0036 //! visualized with each of its faces, and calculating the visible and the hidden parts of each
0037 //! edge. For a given projection, HLRBRep_Algo calculates a set of lines characteristic of the
0038 //! object being represented. It is also used in conjunction with the
0039 //! HLRBRep_HLRToShape extraction utilities, which reconstruct a new, simplified shape
0040 //! from a selection of calculation results. This new shape is made up of edges, which
0041 //! represent the shape visualized in the projection.
0042 //! HLRBRep_Algo takes the shape itself into account whereas HLRBRep_PolyAlgo
0043 //! works with a polyhedral simplification of the shape. When you use HLRBRep_Algo, you
0044 //! obtain an exact result, whereas, when you use HLRBRep_PolyAlgo, you reduce
0045 //! computation time but obtain polygonal segments. In the case of complicated
0046 //! shapes, HLRBRep_Algo may be time-consuming.
0047 //! An HLRBRep_Algo object provides a framework for:
0048 //! -   defining the point of view
0049 //! -   identifying the shape or shapes to be visualized
0050 //! -   calculating the outlines
0051 //! -   calculating the visible and hidden lines of the shape.
0052 //! Warning
0053 //! -   Superimposed lines are not eliminated by this algorithm.
0054 //! -   There must be no unfinished objects inside the shape you wish to visualize.
0055 //! -   Points are not treated.
0056 //! -   Note that this is not the sort of algorithm used in generating shading, which
0057 //! calculates the visible and hidden parts of each face in a shape to be visualized by
0058 //! comparing each face in the shape with every other face in the same shape.
0059 class HLRBRep_Algo : public HLRBRep_InternalAlgo
0060 {
0061 
0062 public:
0063   //! Constructs an empty framework for the
0064   //! calculation of visible and hidden lines of a shape in a projection.
0065   //! Use the function:
0066   //! -   Projector to define the point of view
0067   //! -   Add to select the shape or shapes to be visualized
0068   //! -   Update to compute the outlines of the shape, and
0069   //! -   Hide to compute the visible and hidden lines of the shape.
0070   Standard_EXPORT HLRBRep_Algo();
0071 
0072   Standard_EXPORT HLRBRep_Algo(const occ::handle<HLRBRep_Algo>& A);
0073 
0074   //! add the Shape <S>.
0075   Standard_EXPORT void Add(const TopoDS_Shape&                    S,
0076                            const occ::handle<Standard_Transient>& SData,
0077                            const int                              nbIso = 0);
0078 
0079   //! Adds the shape S to this framework, and
0080   //! specifies the number of isoparameters nbiso desired in visualizing S.
0081   //! You may add as many shapes as you wish. Use the function Add once for each shape.
0082   Standard_EXPORT void Add(const TopoDS_Shape& S, const int nbIso = 0);
0083 
0084   //! return the index of the Shape <S> and
0085   //! return 0 if the Shape <S> is not found.
0086   Standard_EXPORT int Index(const TopoDS_Shape& S);
0087 
0088   //! nullify all the results of OutLiner from HLRTopoBRep.
0089   Standard_EXPORT void OutLinedShapeNullify();
0090 
0091   DEFINE_STANDARD_RTTIEXT(HLRBRep_Algo, HLRBRep_InternalAlgo)
0092 };
0093 
0094 #endif // _HLRBRep_Algo_HeaderFile