0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / StdPrs / StdPrs_WFShape.hxx
CommitLineData
d5f74e42 1// Copyright (c) 2013-2014 OPEN CASCADE SAS
b311480e 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
b311480e 4//
d5f74e42 5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
b311480e 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
b311480e 13
d7223c76 14#ifndef _StdPrs_WFShape_H__
15#define _StdPrs_WFShape_H__
7fd59977 16
d7223c76 17#include <Prs3d_Root.hxx>
d7223c76 18#include <Prs3d_Drawer.hxx>
5ad8c033 19#include <Prs3d_Presentation.hxx>
20#include <Prs3d_PointAspect.hxx>
21#include <Prs3d_LineAspect.hxx>
1b9f5d95 22#include <Prs3d_NListOfSequenceOfPnt.hxx>
5ad8c033 23#include <TColgp_SequenceOfPnt.hxx>
24#include <TopoDS_Shape.hxx>
25#include <TopTools_ListOfShape.hxx>
7fd59977 26
bf5f0ca2 27class Graphic3d_ArrayOfPoints;
28
5ad8c033 29//! Tool for computing wireframe presentation of a TopoDS_Shape.
c151c0f1 30class StdPrs_WFShape : public Prs3d_Root
31{
c151c0f1 32public:
33
5ad8c033 34 //! Computes wireframe presentation of a shape.
35 //! @param thePresentation [in] the presentation.
36 //! @param theShape [in] the shape.
37 //! @param theDrawer [in] the draw settings.
884cafd8 38 //! @param theIsParallel [in] perform algorithm using multiple threads
39 Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& thePresentation,
40 const TopoDS_Shape& theShape,
41 const Handle(Prs3d_Drawer)& theDrawer,
42 Standard_Boolean theIsParallel = Standard_False);
c151c0f1 43
0a863061 44 //! Compute free and boundary edges on a triangulation of each face in the given shape.
45 //! @param theShape [in] the list of triangulated faces
46 //! @param theToExcludeGeometric [in] flag indicating that Faces with defined Surface should be skipped
47 Standard_EXPORT static Handle(Graphic3d_ArrayOfPrimitives) AddEdgesOnTriangulation (const TopoDS_Shape& theShape,
48 const Standard_Boolean theToExcludeGeometric = Standard_True);
49
50 //! Compute free and boundary edges on a triangulation of each face in the given shape.
51 //! @param theSegments [in] the sequence of points defining segments
52 //! @param theShape [in] the list of triangulated faces
53 //! @param theToExcludeGeometric [in] flag indicating that Faces with defined Surface should be skipped
54 Standard_EXPORT static void AddEdgesOnTriangulation (TColgp_SequenceOfPnt& theSegments,
55 const TopoDS_Shape& theShape,
56 const Standard_Boolean theToExcludeGeometric = Standard_True);
57
bf5f0ca2 58 //! Compute all edges (wire, free, unfree) and put them into single primitive array.
59 //! @param theShape [in] the shape
60 //! @param theDrawer [in] the drawer settings (deviation angle and maximal parameter value)
61 Standard_EXPORT static Handle(Graphic3d_ArrayOfPrimitives) AddAllEdges (const TopoDS_Shape& theShape,
62 const Handle(Prs3d_Drawer)& theDrawer);
63
64 //! Compute vertex presentation for a shape.
65 //! @param theShape [in] the shape
66 //! @param theVertexMode [in] vertex filter
67 Standard_EXPORT static Handle(Graphic3d_ArrayOfPoints) AddVertexes (const TopoDS_Shape& theShape,
68 Prs3d_VertexDrawMode theVertexMode);
69
c151c0f1 70private:
71
5ad8c033 72 //! Compute edge presentations for a shape.
bf5f0ca2 73 //! @param theShape [in] the shape
74 //! @param theDrawer [in] the drawer settings (deviation angle and maximal parameter value)
75 //! @param theShapeDeflection [in] the deflection for the wireframe shape
76 //! @param theWire [out] output polylines for lonely wires
77 //! @param theFree [out] output polylines for free edges
78 //! @param theUnFree [out] output polylines for non-free edges
79 Standard_EXPORT static void addEdges (const TopoDS_Shape& theShape,
80 const Handle(Prs3d_Drawer)& theDrawer,
81 Standard_Real theShapeDeflection,
82 Prs3d_NListOfSequenceOfPnt* theWire,
83 Prs3d_NListOfSequenceOfPnt* theFree,
84 Prs3d_NListOfSequenceOfPnt* theUnFree);
85
86 //! Compute edge presentations for a shape.
87 //! @param theEdges [in] the list of edges
88 //! @param theDrawer [in] the drawer settings (deviation angle and maximal parameter value)
89 //! @param theShapeDeflection [in] the deflection for the wireframe shape
90 //! @param thePolylines [out] output polylines
1b9f5d95 91 static void addEdges (const TopTools_ListOfShape& theEdges,
92 const Handle(Prs3d_Drawer)& theDrawer,
93 const Standard_Real theShapeDeflection,
94 Prs3d_NListOfSequenceOfPnt& thePolylines);
c151c0f1 95
c151c0f1 96};
97
98#endif // _StdPrs_WFShape_H__