Skip to content

Commit 2b2cc9d

Browse files
author
ssv
committed
Refactor a bit.
1 parent ee56586 commit 2b2cc9d

35 files changed

+917
-220
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
*.igs eol=lf
3434
*.ply eol=lf
3535
*.iges eol=lf
36-
*.stp eol=lf
37-
*.step eol=lf
3836
*.brep eol=lf
3937
*.rle eol=lf
4038
*.vrml eol=lf

data/cad/anomalies/gmsh_debugSurface.brep

Lines changed: 226 additions & 0 deletions
Large diffs are not rendered by default.

data/cad/cylinder.stp

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
ISO-10303-21;
2+
HEADER;
3+
FILE_DESCRIPTION(('Open CASCADE Model'),'2;1');
4+
FILE_NAME('Open CASCADE Shape Model','2020-03-12T16:28:50',(
5+
'CAD Processor'),('OPEN CASCADE S.A.S'),
6+
'Open CASCADE STEP processor 7.4','CAD Processor','Unknown');
7+
FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }'));
8+
ENDSEC;
9+
DATA;
10+
#1 = APPLICATION_PROTOCOL_DEFINITION('international standard',
11+
'automotive_design',2000,#2);
12+
#2 = APPLICATION_CONTEXT(
13+
'core data for automotive mechanical design processes');
14+
#3 = SHAPE_DEFINITION_REPRESENTATION(#4,#10);
15+
#4 = PRODUCT_DEFINITION_SHAPE('','',#5);
16+
#5 = PRODUCT_DEFINITION('design','',#6,#9);
17+
#6 = PRODUCT_DEFINITION_FORMATION('','',#7);
18+
#7 = PRODUCT('bolt','bolt','',(#8));
19+
#8 = PRODUCT_CONTEXT('',#2,'mechanical');
20+
#9 = PRODUCT_DEFINITION_CONTEXT('part definition',#2,'design');
21+
#10 = ADVANCED_BREP_SHAPE_REPRESENTATION('',(#11,#15),#68);
22+
#11 = AXIS2_PLACEMENT_3D('',#12,#13,#14);
23+
#12 = CARTESIAN_POINT('',(0.E+000,0.E+000,0.E+000));
24+
#13 = DIRECTION('',(0.E+000,0.E+000,1.));
25+
#14 = DIRECTION('',(1.,0.E+000,-0.E+000));
26+
#15 = MANIFOLD_SOLID_BREP('',#16);
27+
#16 = CLOSED_SHELL('',(#17,#50,#59));
28+
#17 = ADVANCED_FACE('',(#18),#45,.T.);
29+
#18 = FACE_BOUND('',#19,.T.);
30+
#19 = EDGE_LOOP('',(#20,#29,#37,#44));
31+
#20 = ORIENTED_EDGE('',*,*,#21,.F.);
32+
#21 = EDGE_CURVE('',#22,#22,#24,.T.);
33+
#22 = VERTEX_POINT('',#23);
34+
#23 = CARTESIAN_POINT('',(-67.11767756827,220.00000043927,
35+
-260.7772406204));
36+
#24 = CIRCLE('',#25,6.752432121259);
37+
#25 = AXIS2_PLACEMENT_3D('',#26,#27,#28);
38+
#26 = CARTESIAN_POINT('',(-67.75000443396,220.00000025387,
39+
-267.5000006404));
40+
#27 = DIRECTION('',(-5.546304734425E-008,1.,-2.236060986829E-008));
41+
#28 = DIRECTION('',(9.364431279469E-002,2.745614996283E-008,
42+
0.995605716477));
43+
#29 = ORIENTED_EDGE('',*,*,#30,.F.);
44+
#30 = EDGE_CURVE('',#31,#22,#33,.T.);
45+
#31 = VERTEX_POINT('',#32);
46+
#32 = CARTESIAN_POINT('',(-67.11767521109,177.49999964728,
47+
-260.7772396701));
48+
#33 = LINE('',#34,#35);
49+
#34 = CARTESIAN_POINT('',(-67.11767521109,177.49999964728,
50+
-260.7772396701));
51+
#35 = VECTOR('',#36,1.);
52+
#36 = DIRECTION('',(-5.546304734425E-008,1.,-2.236060986829E-008));
53+
#37 = ORIENTED_EDGE('',*,*,#38,.T.);
54+
#38 = EDGE_CURVE('',#31,#31,#39,.T.);
55+
#39 = CIRCLE('',#40,6.752432121259);
56+
#40 = AXIS2_PLACEMENT_3D('',#41,#42,#43);
57+
#41 = CARTESIAN_POINT('',(-67.75000207678,177.49999946188,
58+
-267.4999996901));
59+
#42 = DIRECTION('',(-5.546304734425E-008,1.,-2.236060986829E-008));
60+
#43 = DIRECTION('',(9.364431279469E-002,2.745614996283E-008,
61+
0.995605716477));
62+
#44 = ORIENTED_EDGE('',*,*,#30,.T.);
63+
#45 = CYLINDRICAL_SURFACE('',#46,6.752432121259);
64+
#46 = AXIS2_PLACEMENT_3D('',#47,#48,#49);
65+
#47 = CARTESIAN_POINT('',(-67.75000207678,177.49999946188,
66+
-267.4999996901));
67+
#48 = DIRECTION('',(-5.546304734425E-008,1.,-2.236060986829E-008));
68+
#49 = DIRECTION('',(9.364431279469E-002,2.745614996283E-008,
69+
0.995605716477));
70+
#50 = ADVANCED_FACE('',(#51),#54,.T.);
71+
#51 = FACE_BOUND('',#52,.T.);
72+
#52 = EDGE_LOOP('',(#53));
73+
#53 = ORIENTED_EDGE('',*,*,#21,.T.);
74+
#54 = PLANE('',#55);
75+
#55 = AXIS2_PLACEMENT_3D('',#56,#57,#58);
76+
#56 = CARTESIAN_POINT('',(-67.75000443396,220.00000025387,
77+
-267.5000006404));
78+
#57 = DIRECTION('',(-5.546304734425E-008,1.,-2.236060986829E-008));
79+
#58 = DIRECTION('',(9.364431279469E-002,2.745614996283E-008,
80+
0.995605716477));
81+
#59 = ADVANCED_FACE('',(#60),#63,.F.);
82+
#60 = FACE_BOUND('',#61,.T.);
83+
#61 = EDGE_LOOP('',(#62));
84+
#62 = ORIENTED_EDGE('',*,*,#38,.F.);
85+
#63 = PLANE('',#64);
86+
#64 = AXIS2_PLACEMENT_3D('',#65,#66,#67);
87+
#65 = CARTESIAN_POINT('',(-67.75000207678,177.49999946188,
88+
-267.4999996901));
89+
#66 = DIRECTION('',(-5.546304734425E-008,1.,-2.236060986829E-008));
90+
#67 = DIRECTION('',(9.364431279469E-002,2.745614996283E-008,
91+
0.995605716477));
92+
#68 = ( GEOMETRIC_REPRESENTATION_CONTEXT(3)
93+
GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#72)) GLOBAL_UNIT_ASSIGNED_CONTEXT(
94+
(#69,#70,#71)) REPRESENTATION_CONTEXT('Context #1',
95+
'3D Context with UNIT and UNCERTAINTY') );
96+
#69 = ( LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.) );
97+
#70 = ( NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.) );
98+
#71 = ( NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT() );
99+
#72 = UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.E-007),#69,
100+
'distance_accuracy_value','confusion accuracy');
101+
#73 = PRODUCT_RELATED_PRODUCT_CATEGORY('part',$,(#7));
102+
ENDSEC;
103+
END-ISO-10303-21;

data/cad/sphere.stp

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
ISO-10303-21;
2+
HEADER;
3+
FILE_DESCRIPTION(('Open CASCADE Model'),'2;1');
4+
FILE_NAME('Open CASCADE Shape Model','2020-03-13T09:44:54',(
5+
'CAD Processor'),('OPEN CASCADE S.A.S'),
6+
'Open CASCADE STEP processor 7.4','CAD Processor','Unknown');
7+
FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }'));
8+
ENDSEC;
9+
DATA;
10+
#1 = APPLICATION_PROTOCOL_DEFINITION('international standard',
11+
'automotive_design',2000,#2);
12+
#2 = APPLICATION_CONTEXT(
13+
'core data for automotive mechanical design processes');
14+
#3 = SHAPE_DEFINITION_REPRESENTATION(#4,#10);
15+
#4 = PRODUCT_DEFINITION_SHAPE('','',#5);
16+
#5 = PRODUCT_DEFINITION('design','',#6,#9);
17+
#6 = PRODUCT_DEFINITION_FORMATION('','',#7);
18+
#7 = PRODUCT('bolt','bolt','',(#8));
19+
#8 = PRODUCT_CONTEXT('',#2,'mechanical');
20+
#9 = PRODUCT_DEFINITION_CONTEXT('part definition',#2,'design');
21+
#10 = ADVANCED_BREP_SHAPE_REPRESENTATION('',(#11,#15),#27);
22+
#11 = AXIS2_PLACEMENT_3D('',#12,#13,#14);
23+
#12 = CARTESIAN_POINT('',(0.E+000,0.E+000,0.E+000));
24+
#13 = DIRECTION('',(0.E+000,0.E+000,1.));
25+
#14 = DIRECTION('',(1.,0.E+000,-0.E+000));
26+
#15 = MANIFOLD_SOLID_BREP('',#16);
27+
#16 = CLOSED_SHELL('',(#17));
28+
#17 = ADVANCED_FACE('',(#18),#22,.T.);
29+
#18 = FACE_BOUND('',#19,.T.);
30+
#19 = VERTEX_LOOP('',#20);
31+
#20 = VERTEX_POINT('',#21);
32+
#21 = CARTESIAN_POINT('',(-68.59280045128,198.74999961077,
33+
-276.4604594472));
34+
#22 = SPHERICAL_SURFACE('',#23,9.000007647587);
35+
#23 = AXIS2_PLACEMENT_3D('',#24,#25,#26);
36+
#24 = CARTESIAN_POINT('',(-67.75000091998,198.74999985788,
37+
-267.5000003849));
38+
#25 = DIRECTION('',(9.364431279469E-002,2.745614996283E-008,
39+
0.995605716477));
40+
#26 = DIRECTION('',(0.995605716477,5.312538304437E-008,
41+
-9.364431279469E-002));
42+
#27 = ( GEOMETRIC_REPRESENTATION_CONTEXT(3)
43+
GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#31)) GLOBAL_UNIT_ASSIGNED_CONTEXT(
44+
(#28,#29,#30)) REPRESENTATION_CONTEXT('Context #1',
45+
'3D Context with UNIT and UNCERTAINTY') );
46+
#28 = ( LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.) );
47+
#29 = ( NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.) );
48+
#30 = ( NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT() );
49+
#31 = UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.E-007),#28,
50+
'distance_accuracy_value','confusion accuracy');
51+
#32 = PRODUCT_RELATED_PRODUCT_CATEGORY('part',$,(#7));
52+
ENDSEC;
53+
END-ISO-10303-21;

src/asiData/asiData_NodeFlags.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,29 @@
4040
//! so other GUI services might want to use some other set of user flags.
4141
enum asiData_NodeFlags
4242
{
43-
//! Indicates whether the Data Node can be presented in 3D viewer shipped
44-
//! with the framework.
45-
NodeFlag_IsPresentedInPartView = 0x00001,
43+
//! Indicates whether the Data Node can be presented in 3D viewer tailored
44+
//! to parts.
45+
NodeFlag_IsPresentedInPartView = 0x001,
46+
47+
//! Indicates whether the Data Node can be presented in 3D viewer tailored
48+
//! to the host geometry.
49+
NodeFlag_IsPresentedInHostView = 0x002,
50+
51+
//! Indicates whether the Data Node can be presented in 3D viewer tailored
52+
//! to the parameteric domain.
53+
NodeFlag_IsPresentedInDomainView = 0x004,
4654

4755
//! Indicates that 3D Presentation is currently visible.
48-
NodeFlag_IsPresentationVisible = 0x00002,
56+
NodeFlag_IsPresentationVisible = 0x008,
4957

5058
//! Indicates that Data Node should not be displayed in Object Browser
5159
//! even if its Tree Node connectivity allows it.
52-
NodeFlag_IsHiddenInBrowser = 0x00004,
60+
NodeFlag_IsHiddenInBrowser = 0x010,
5361

5462
//! Indicates whether this Data Node is structural or not. We say that
5563
//! Data Node is structural if it is an essential (and so immutable)
5664
//! part of the Project tree.
57-
NodeFlag_IsStructural = 0x00008,
65+
NodeFlag_IsStructural = 0x020,
5866

5967
};
6068

src/asiData/mesh/asiData_TriangulationNode.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,3 @@ bool asiData_TriangulationNode::HasVertices() const
212212
{
213213
return ActParamTool::AsBool( this->Parameter(PID_HasVertices) )->GetValue();
214214
}
215-
216-
//! \return underlying Node which stores octree.
217-
Handle(asiData_OctreeNode) asiData_TriangulationNode::GetOctree() const
218-
{
219-
Handle(asiData_OctreeNode) octree_n;
220-
for ( Handle(ActAPI_IChildIterator) cit = this->GetChildIterator(); cit->More(); cit->Next() )
221-
{
222-
octree_n = Handle(asiData_OctreeNode)::DownCast( cit->Value() );
223-
224-
if ( !octree_n.IsNull() && octree_n->IsWellFormed() )
225-
return octree_n;
226-
}
227-
228-
return nullptr;
229-
}

src/asiData/mesh/asiData_TriangulationNode.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define asiData_TriangulationNode_h
3333

3434
// asiData includes
35-
#include <asiData_OctreeNode.h>
35+
#include <asiData.h>
3636

3737
// asiAlgo includes
3838
#include <asiAlgo_BVHFacets.h>
@@ -42,8 +42,6 @@
4242
#include <ActData_TriangulationParameter.h>
4343
#include <ActData_Utils.h>
4444

45-
//-----------------------------------------------------------------------------
46-
// Mesh Node
4745
//-----------------------------------------------------------------------------
4846

4947
//! Node representing surface triangulation.
@@ -149,11 +147,6 @@ class asiData_TriangulationNode : public ActData_BaseNode
149147
asiData_EXPORT bool
150148
HasVertices() const;
151149

152-
public:
153-
154-
asiData_EXPORT Handle(asiData_OctreeNode)
155-
GetOctree() const;
156-
157150
// Initialization:
158151
public:
159152

src/asiData/misc/asiData_OctreeNode.cpp

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
// Own include
3232
#include <asiData_OctreeNode.h>
3333

34+
// asiData includes
35+
#include <asiData_BVHParameter.h>
36+
3437
// asiAlgo includes
3538
#include <asiAlgo_Utils.h>
3639

@@ -62,11 +65,13 @@ asiData_OctreeNode::asiData_OctreeNode() : ActData_BaseNode()
6265
REGISTER_PARAMETER(Group, PID_OutputsGroup);
6366
REGISTER_PARAMETER(Int, PID_SamplingStrategy);
6467
REGISTER_PARAMETER(Bool, PID_ExtractPoints);
68+
REGISTER_PARAMETER(Real, PID_PointSize);
6569
REGISTER_PARAMETER(Real, PID_MaxVectorSize);
6670
REGISTER_PARAMETER(Int, PID_NumElements);
6771

6872
// Register custom Parameters specific to Analysis Situs.
69-
this->registerParameter(PID_Octree, asiData_OctreeParameter::Instance(), false);
73+
this->registerParameter(PID_BVH, asiData_BVHParameter ::Instance(), false);
74+
this->registerParameter(PID_Octree, asiData_OctreeParameter ::Instance(), false);
7075
}
7176

7277
//-----------------------------------------------------------------------------
@@ -81,6 +86,7 @@ Handle(ActAPI_INode) asiData_OctreeNode::Instance()
8186
void asiData_OctreeNode::Init()
8287
{
8388
// Set default values.
89+
this->SetBVH (nullptr);
8490
this->SetOctree (nullptr);
8591
this->SetMinCellSize (1.);
8692
this->SetMaxCellSize (100.);
@@ -90,6 +96,7 @@ void asiData_OctreeNode::Init()
9096
this->SetDomainCube (false);
9197
this->SetSamplingStrategy (0x01 | 0x02 | 0x04);
9298
this->SetExtractPoints (false);
99+
this->SetPointSize (1.);
93100
this->SetMaxVectorSize (1.);
94101
this->SetNumElements (0);
95102

@@ -113,6 +120,7 @@ void asiData_OctreeNode::Init()
113120
this->InitParameter(PID_OutputsGroup, "Outputs", "", ParameterFlag_IsVisible, true);
114121
this->InitParameter(PID_SamplingStrategy, "Sampling strategy", "Octree_SS", ParameterFlag_IsVisible, true);
115122
this->InitParameter(PID_ExtractPoints, "Extract points", "", ParameterFlag_IsVisible, true);
123+
this->InitParameter(PID_PointSize, "Point size", "", ParameterFlag_IsVisible, true);
116124
this->InitParameter(PID_MaxVectorSize, "Max norm modulus", "", ParameterFlag_IsVisible, true);
117125
this->InitParameter(PID_NumElements, "Num. of elements", "Octree_NumElems", ParameterFlag_IsVisible, true);
118126

@@ -134,6 +142,20 @@ void asiData_OctreeNode::SetName(const TCollection_ExtendedString& name)
134142

135143
//-----------------------------------------------------------------------------
136144

145+
void asiData_OctreeNode::SetBVH(const Handle(asiAlgo_BVHFacets)& bvhFacets)
146+
{
147+
Handle(asiData_BVHParameter)::DownCast( this->Parameter(PID_BVH) )->SetBVH(bvhFacets);
148+
}
149+
150+
//-----------------------------------------------------------------------------
151+
152+
Handle(asiAlgo_BVHFacets) asiData_OctreeNode::GetBVH() const
153+
{
154+
return Handle(asiData_BVHParameter)::DownCast( this->Parameter(PID_BVH) )->GetBVH();
155+
}
156+
157+
//-----------------------------------------------------------------------------
158+
137159
void* asiData_OctreeNode::GetOctree() const
138160
{
139161
return Handle(asiData_OctreeParameter)::DownCast( this->Parameter(PID_Octree) )->GetOctree();
@@ -176,6 +198,20 @@ void asiData_OctreeNode::SetExtractPoints(const bool toExtract)
176198

177199
//-----------------------------------------------------------------------------
178200

201+
double asiData_OctreeNode::GetPointSize() const
202+
{
203+
return ActParamTool::AsReal( this->Parameter(PID_PointSize) )->GetValue();
204+
}
205+
206+
//-----------------------------------------------------------------------------
207+
208+
void asiData_OctreeNode::SetPointSize(const double size)
209+
{
210+
ActParamTool::AsReal( this->Parameter(PID_PointSize) )->SetValue(size);
211+
}
212+
213+
//-----------------------------------------------------------------------------
214+
179215
double asiData_OctreeNode::GetMaxVectorSize() const
180216
{
181217
return ActParamTool::AsReal( this->Parameter(PID_MaxVectorSize) )->GetValue();

0 commit comments

Comments
 (0)