Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1997-04-17
0002 // Created by: Christophe MARION
0003 // Copyright (c) 1997-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_InternalAlgo_HeaderFile
0018 #define _HLRBRep_InternalAlgo_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <HLRAlgo_Projector.hxx>
0024 #include <HLRBRep_ShapeBounds.hxx>
0025 #include <NCollection_Sequence.hxx>
0026 #include <TopoDS_Shape.hxx>
0027 #include <BRepTopAdaptor_Tool.hxx>
0028 #include <TopTools_ShapeMapHasher.hxx>
0029 #include <NCollection_DataMap.hxx>
0030 #include <Standard_Transient.hxx>
0031 #include <Standard_Integer.hxx>
0032 class HLRBRep_Data;
0033 class HLRTopoBRep_OutLiner;
0034 class HLRBRep_ShapeBounds;
0035 
0036 class HLRBRep_InternalAlgo : public Standard_Transient
0037 {
0038 
0039 public:
0040   Standard_EXPORT HLRBRep_InternalAlgo();
0041 
0042   Standard_EXPORT HLRBRep_InternalAlgo(const occ::handle<HLRBRep_InternalAlgo>& A);
0043 
0044   //! set the projector.
0045   Standard_EXPORT void Projector(const HLRAlgo_Projector& P);
0046 
0047   //! set the projector.
0048   Standard_EXPORT HLRAlgo_Projector& Projector();
0049 
0050   //! update the DataStructure.
0051   Standard_EXPORT void Update();
0052 
0053   //! add the shape <S>.
0054   Standard_EXPORT void Load(const occ::handle<HLRTopoBRep_OutLiner>& S,
0055                             const occ::handle<Standard_Transient>&   SData,
0056                             const int                                nbIso = 0);
0057 
0058   //! add the shape <S>.
0059   Standard_EXPORT void Load(const occ::handle<HLRTopoBRep_OutLiner>& S, const int nbIso = 0);
0060 
0061   //! return the index of the Shape <S> and return 0 if
0062   //! the Shape <S> is not found.
0063   Standard_EXPORT int Index(const occ::handle<HLRTopoBRep_OutLiner>& S) const;
0064 
0065   //! remove the Shape of Index <I>.
0066   Standard_EXPORT void Remove(const int I);
0067 
0068   //! Change the Shape Data of the Shape of index <I>.
0069   Standard_EXPORT void ShapeData(const int I, const occ::handle<Standard_Transient>& SData);
0070 
0071   Standard_EXPORT NCollection_Sequence<HLRBRep_ShapeBounds>& SeqOfShapeBounds();
0072 
0073   Standard_EXPORT int NbShapes() const;
0074 
0075   Standard_EXPORT HLRBRep_ShapeBounds& ShapeBounds(const int I);
0076 
0077   //! init the status of the selected edges depending of
0078   //! the back faces of a closed shell.
0079   Standard_EXPORT void InitEdgeStatus();
0080 
0081   //! select all the DataStructure.
0082   Standard_EXPORT void Select();
0083 
0084   //! select only the Shape of index <I>.
0085   Standard_EXPORT void Select(const int I);
0086 
0087   //! select only the edges of the Shape <S>.
0088   Standard_EXPORT void SelectEdge(const int I);
0089 
0090   //! select only the faces of the Shape <S>.
0091   Standard_EXPORT void SelectFace(const int I);
0092 
0093   //! set to visible all the edges.
0094   Standard_EXPORT void ShowAll();
0095 
0096   //! set to visible all the edges of the Shape <S>.
0097   Standard_EXPORT void ShowAll(const int I);
0098 
0099   //! set to hide all the edges.
0100   Standard_EXPORT void HideAll();
0101 
0102   //! set to hide all the edges of the Shape <S>.
0103   Standard_EXPORT void HideAll(const int I);
0104 
0105   //! own hiding of all the shapes of the DataStructure
0106   //! without hiding by each other.
0107   Standard_EXPORT void PartialHide();
0108 
0109   //! hide all the DataStructure.
0110   Standard_EXPORT void Hide();
0111 
0112   //! hide the Shape <S> by itself.
0113   Standard_EXPORT void Hide(const int I);
0114 
0115   //! hide the Shape <S1> by the shape <S2>.
0116   Standard_EXPORT void Hide(const int I, const int J);
0117 
0118   Standard_EXPORT void Debug(const bool deb);
0119 
0120   Standard_EXPORT bool Debug() const;
0121 
0122   Standard_EXPORT occ::handle<HLRBRep_Data> DataStructure() const;
0123 
0124   DEFINE_STANDARD_RTTIEXT(HLRBRep_InternalAlgo, Standard_Transient)
0125 
0126 private:
0127   //! first if <SideFace> own hiding of the side faces.
0128   //! After hiding of the selected parts of the
0129   //! DataStructure.
0130   Standard_EXPORT void HideSelected(const int I, const bool SideFace);
0131 
0132   occ::handle<HLRBRep_Data>                                                       myDS;
0133   HLRAlgo_Projector                                                               myProj;
0134   NCollection_Sequence<HLRBRep_ShapeBounds>                                       myShapes;
0135   NCollection_DataMap<TopoDS_Shape, BRepTopAdaptor_Tool, TopTools_ShapeMapHasher> myMapOfShapeTool;
0136   bool                                                                            myDebug;
0137 };
0138 
0139 #endif // _HLRBRep_InternalAlgo_HeaderFile