Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-23 09:17:15

0001 // Created on: 1995-03-06
0002 // Created by: Laurent PAINNOT
0003 // Copyright (c) 1995-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 _DrawTrSurf_Triangulation_HeaderFile
0018 #define _DrawTrSurf_Triangulation_HeaderFile
0019 
0020 #include <Standard_Integer.hxx>
0021 #include <NCollection_Array1.hxx>
0022 #include <NCollection_HArray1.hxx>
0023 #include <Draw_Drawable3D.hxx>
0024 #include <Draw_Interpretor.hxx>
0025 
0026 class Poly_Triangulation;
0027 
0028 //! Used to display a triangulation.
0029 //!
0030 //! Display internal edges in blue
0031 //! Display boundary edges in red
0032 //! Optional display of triangles and nodes indices.
0033 class DrawTrSurf_Triangulation : public Draw_Drawable3D
0034 {
0035   DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Triangulation, Draw_Drawable3D)
0036   Draw_Drawable3D_FACTORY
0037 public:
0038   Standard_EXPORT DrawTrSurf_Triangulation(const occ::handle<Poly_Triangulation>& T);
0039 
0040   occ::handle<Poly_Triangulation> Triangulation() const { return myTriangulation; }
0041 
0042   void ShowNodes(const bool theB) { myNodes = theB; }
0043 
0044   bool ShowNodes() const { return myNodes; }
0045 
0046   void ShowTriangles(const bool theB) { myTriangles = theB; }
0047 
0048   bool ShowTriangles() const { return myTriangles; }
0049 
0050   Standard_EXPORT void DrawOn(Draw_Display& dis) const override;
0051 
0052   //! For variable copy.
0053   Standard_EXPORT occ::handle<Draw_Drawable3D> Copy() const override;
0054 
0055   //! For variable dump.
0056   Standard_EXPORT void Dump(Standard_OStream& S) const override;
0057 
0058   //! Save drawable into stream.
0059   Standard_EXPORT void Save(Standard_OStream& theStream) const override;
0060 
0061   //! For variable whatis command. Set as a result the type of the variable.
0062   Standard_EXPORT void Whatis(Draw_Interpretor& I) const override;
0063 
0064 private:
0065   occ::handle<Poly_Triangulation>       myTriangulation;
0066   occ::handle<NCollection_HArray1<int>> myInternals;
0067   occ::handle<NCollection_HArray1<int>> myFree;
0068   bool                                  myNodes;
0069   bool                                  myTriangles;
0070 };
0071 
0072 #endif // _DrawTrSurf_Triangulation_HeaderFile