Skip to content

Commit

Permalink
Refactor a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
ssv committed Mar 13, 2020
1 parent ee56586 commit 2b2cc9d
Show file tree
Hide file tree
Showing 35 changed files with 917 additions and 220 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
*.igs eol=lf
*.ply eol=lf
*.iges eol=lf
*.stp eol=lf
*.step eol=lf
*.brep eol=lf
*.rle eol=lf
*.vrml eol=lf
Expand Down
226 changes: 226 additions & 0 deletions data/cad/anomalies/gmsh_debugSurface.brep

Large diffs are not rendered by default.

103 changes: 103 additions & 0 deletions data/cad/cylinder.stp
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('Open CASCADE Model'),'2;1');
FILE_NAME('Open CASCADE Shape Model','2020-03-12T16:28:50',(
'CAD Processor'),('OPEN CASCADE S.A.S'),
'Open CASCADE STEP processor 7.4','CAD Processor','Unknown');
FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }'));
ENDSEC;
DATA;
#1 = APPLICATION_PROTOCOL_DEFINITION('international standard',
'automotive_design',2000,#2);
#2 = APPLICATION_CONTEXT(
'core data for automotive mechanical design processes');
#3 = SHAPE_DEFINITION_REPRESENTATION(#4,#10);
#4 = PRODUCT_DEFINITION_SHAPE('','',#5);
#5 = PRODUCT_DEFINITION('design','',#6,#9);
#6 = PRODUCT_DEFINITION_FORMATION('','',#7);
#7 = PRODUCT('bolt','bolt','',(#8));
#8 = PRODUCT_CONTEXT('',#2,'mechanical');
#9 = PRODUCT_DEFINITION_CONTEXT('part definition',#2,'design');
#10 = ADVANCED_BREP_SHAPE_REPRESENTATION('',(#11,#15),#68);
#11 = AXIS2_PLACEMENT_3D('',#12,#13,#14);
#12 = CARTESIAN_POINT('',(0.E+000,0.E+000,0.E+000));
#13 = DIRECTION('',(0.E+000,0.E+000,1.));
#14 = DIRECTION('',(1.,0.E+000,-0.E+000));
#15 = MANIFOLD_SOLID_BREP('',#16);
#16 = CLOSED_SHELL('',(#17,#50,#59));
#17 = ADVANCED_FACE('',(#18),#45,.T.);
#18 = FACE_BOUND('',#19,.T.);
#19 = EDGE_LOOP('',(#20,#29,#37,#44));
#20 = ORIENTED_EDGE('',*,*,#21,.F.);
#21 = EDGE_CURVE('',#22,#22,#24,.T.);
#22 = VERTEX_POINT('',#23);
#23 = CARTESIAN_POINT('',(-67.11767756827,220.00000043927,
-260.7772406204));
#24 = CIRCLE('',#25,6.752432121259);
#25 = AXIS2_PLACEMENT_3D('',#26,#27,#28);
#26 = CARTESIAN_POINT('',(-67.75000443396,220.00000025387,
-267.5000006404));
#27 = DIRECTION('',(-5.546304734425E-008,1.,-2.236060986829E-008));
#28 = DIRECTION('',(9.364431279469E-002,2.745614996283E-008,
0.995605716477));
#29 = ORIENTED_EDGE('',*,*,#30,.F.);
#30 = EDGE_CURVE('',#31,#22,#33,.T.);
#31 = VERTEX_POINT('',#32);
#32 = CARTESIAN_POINT('',(-67.11767521109,177.49999964728,
-260.7772396701));
#33 = LINE('',#34,#35);
#34 = CARTESIAN_POINT('',(-67.11767521109,177.49999964728,
-260.7772396701));
#35 = VECTOR('',#36,1.);
#36 = DIRECTION('',(-5.546304734425E-008,1.,-2.236060986829E-008));
#37 = ORIENTED_EDGE('',*,*,#38,.T.);
#38 = EDGE_CURVE('',#31,#31,#39,.T.);
#39 = CIRCLE('',#40,6.752432121259);
#40 = AXIS2_PLACEMENT_3D('',#41,#42,#43);
#41 = CARTESIAN_POINT('',(-67.75000207678,177.49999946188,
-267.4999996901));
#42 = DIRECTION('',(-5.546304734425E-008,1.,-2.236060986829E-008));
#43 = DIRECTION('',(9.364431279469E-002,2.745614996283E-008,
0.995605716477));
#44 = ORIENTED_EDGE('',*,*,#30,.T.);
#45 = CYLINDRICAL_SURFACE('',#46,6.752432121259);
#46 = AXIS2_PLACEMENT_3D('',#47,#48,#49);
#47 = CARTESIAN_POINT('',(-67.75000207678,177.49999946188,
-267.4999996901));
#48 = DIRECTION('',(-5.546304734425E-008,1.,-2.236060986829E-008));
#49 = DIRECTION('',(9.364431279469E-002,2.745614996283E-008,
0.995605716477));
#50 = ADVANCED_FACE('',(#51),#54,.T.);
#51 = FACE_BOUND('',#52,.T.);
#52 = EDGE_LOOP('',(#53));
#53 = ORIENTED_EDGE('',*,*,#21,.T.);
#54 = PLANE('',#55);
#55 = AXIS2_PLACEMENT_3D('',#56,#57,#58);
#56 = CARTESIAN_POINT('',(-67.75000443396,220.00000025387,
-267.5000006404));
#57 = DIRECTION('',(-5.546304734425E-008,1.,-2.236060986829E-008));
#58 = DIRECTION('',(9.364431279469E-002,2.745614996283E-008,
0.995605716477));
#59 = ADVANCED_FACE('',(#60),#63,.F.);
#60 = FACE_BOUND('',#61,.T.);
#61 = EDGE_LOOP('',(#62));
#62 = ORIENTED_EDGE('',*,*,#38,.F.);
#63 = PLANE('',#64);
#64 = AXIS2_PLACEMENT_3D('',#65,#66,#67);
#65 = CARTESIAN_POINT('',(-67.75000207678,177.49999946188,
-267.4999996901));
#66 = DIRECTION('',(-5.546304734425E-008,1.,-2.236060986829E-008));
#67 = DIRECTION('',(9.364431279469E-002,2.745614996283E-008,
0.995605716477));
#68 = ( GEOMETRIC_REPRESENTATION_CONTEXT(3)
GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#72)) GLOBAL_UNIT_ASSIGNED_CONTEXT(
(#69,#70,#71)) REPRESENTATION_CONTEXT('Context #1',
'3D Context with UNIT and UNCERTAINTY') );
#69 = ( LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.) );
#70 = ( NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.) );
#71 = ( NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT() );
#72 = UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.E-007),#69,
'distance_accuracy_value','confusion accuracy');
#73 = PRODUCT_RELATED_PRODUCT_CATEGORY('part',$,(#7));
ENDSEC;
END-ISO-10303-21;
53 changes: 53 additions & 0 deletions data/cad/sphere.stp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('Open CASCADE Model'),'2;1');
FILE_NAME('Open CASCADE Shape Model','2020-03-13T09:44:54',(
'CAD Processor'),('OPEN CASCADE S.A.S'),
'Open CASCADE STEP processor 7.4','CAD Processor','Unknown');
FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }'));
ENDSEC;
DATA;
#1 = APPLICATION_PROTOCOL_DEFINITION('international standard',
'automotive_design',2000,#2);
#2 = APPLICATION_CONTEXT(
'core data for automotive mechanical design processes');
#3 = SHAPE_DEFINITION_REPRESENTATION(#4,#10);
#4 = PRODUCT_DEFINITION_SHAPE('','',#5);
#5 = PRODUCT_DEFINITION('design','',#6,#9);
#6 = PRODUCT_DEFINITION_FORMATION('','',#7);
#7 = PRODUCT('bolt','bolt','',(#8));
#8 = PRODUCT_CONTEXT('',#2,'mechanical');
#9 = PRODUCT_DEFINITION_CONTEXT('part definition',#2,'design');
#10 = ADVANCED_BREP_SHAPE_REPRESENTATION('',(#11,#15),#27);
#11 = AXIS2_PLACEMENT_3D('',#12,#13,#14);
#12 = CARTESIAN_POINT('',(0.E+000,0.E+000,0.E+000));
#13 = DIRECTION('',(0.E+000,0.E+000,1.));
#14 = DIRECTION('',(1.,0.E+000,-0.E+000));
#15 = MANIFOLD_SOLID_BREP('',#16);
#16 = CLOSED_SHELL('',(#17));
#17 = ADVANCED_FACE('',(#18),#22,.T.);
#18 = FACE_BOUND('',#19,.T.);
#19 = VERTEX_LOOP('',#20);
#20 = VERTEX_POINT('',#21);
#21 = CARTESIAN_POINT('',(-68.59280045128,198.74999961077,
-276.4604594472));
#22 = SPHERICAL_SURFACE('',#23,9.000007647587);
#23 = AXIS2_PLACEMENT_3D('',#24,#25,#26);
#24 = CARTESIAN_POINT('',(-67.75000091998,198.74999985788,
-267.5000003849));
#25 = DIRECTION('',(9.364431279469E-002,2.745614996283E-008,
0.995605716477));
#26 = DIRECTION('',(0.995605716477,5.312538304437E-008,
-9.364431279469E-002));
#27 = ( GEOMETRIC_REPRESENTATION_CONTEXT(3)
GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#31)) GLOBAL_UNIT_ASSIGNED_CONTEXT(
(#28,#29,#30)) REPRESENTATION_CONTEXT('Context #1',
'3D Context with UNIT and UNCERTAINTY') );
#28 = ( LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.) );
#29 = ( NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.) );
#30 = ( NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT() );
#31 = UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.E-007),#28,
'distance_accuracy_value','confusion accuracy');
#32 = PRODUCT_RELATED_PRODUCT_CATEGORY('part',$,(#7));
ENDSEC;
END-ISO-10303-21;
20 changes: 14 additions & 6 deletions src/asiData/asiData_NodeFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,29 @@
//! so other GUI services might want to use some other set of user flags.
enum asiData_NodeFlags
{
//! Indicates whether the Data Node can be presented in 3D viewer shipped
//! with the framework.
NodeFlag_IsPresentedInPartView = 0x00001,
//! Indicates whether the Data Node can be presented in 3D viewer tailored
//! to parts.
NodeFlag_IsPresentedInPartView = 0x001,

//! Indicates whether the Data Node can be presented in 3D viewer tailored
//! to the host geometry.
NodeFlag_IsPresentedInHostView = 0x002,

//! Indicates whether the Data Node can be presented in 3D viewer tailored
//! to the parameteric domain.
NodeFlag_IsPresentedInDomainView = 0x004,

//! Indicates that 3D Presentation is currently visible.
NodeFlag_IsPresentationVisible = 0x00002,
NodeFlag_IsPresentationVisible = 0x008,

//! Indicates that Data Node should not be displayed in Object Browser
//! even if its Tree Node connectivity allows it.
NodeFlag_IsHiddenInBrowser = 0x00004,
NodeFlag_IsHiddenInBrowser = 0x010,

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

};

Expand Down
15 changes: 0 additions & 15 deletions src/asiData/mesh/asiData_TriangulationNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,3 @@ bool asiData_TriangulationNode::HasVertices() const
{
return ActParamTool::AsBool( this->Parameter(PID_HasVertices) )->GetValue();
}

//! \return underlying Node which stores octree.
Handle(asiData_OctreeNode) asiData_TriangulationNode::GetOctree() const
{
Handle(asiData_OctreeNode) octree_n;
for ( Handle(ActAPI_IChildIterator) cit = this->GetChildIterator(); cit->More(); cit->Next() )
{
octree_n = Handle(asiData_OctreeNode)::DownCast( cit->Value() );

if ( !octree_n.IsNull() && octree_n->IsWellFormed() )
return octree_n;
}

return nullptr;
}
9 changes: 1 addition & 8 deletions src/asiData/mesh/asiData_TriangulationNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define asiData_TriangulationNode_h

// asiData includes
#include <asiData_OctreeNode.h>
#include <asiData.h>

// asiAlgo includes
#include <asiAlgo_BVHFacets.h>
Expand All @@ -42,8 +42,6 @@
#include <ActData_TriangulationParameter.h>
#include <ActData_Utils.h>

//-----------------------------------------------------------------------------
// Mesh Node
//-----------------------------------------------------------------------------

//! Node representing surface triangulation.
Expand Down Expand Up @@ -149,11 +147,6 @@ class asiData_TriangulationNode : public ActData_BaseNode
asiData_EXPORT bool
HasVertices() const;

public:

asiData_EXPORT Handle(asiData_OctreeNode)
GetOctree() const;

// Initialization:
public:

Expand Down
38 changes: 37 additions & 1 deletion src/asiData/misc/asiData_OctreeNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
// Own include
#include <asiData_OctreeNode.h>

// asiData includes
#include <asiData_BVHParameter.h>

// asiAlgo includes
#include <asiAlgo_Utils.h>

Expand Down Expand Up @@ -62,11 +65,13 @@ asiData_OctreeNode::asiData_OctreeNode() : ActData_BaseNode()
REGISTER_PARAMETER(Group, PID_OutputsGroup);
REGISTER_PARAMETER(Int, PID_SamplingStrategy);
REGISTER_PARAMETER(Bool, PID_ExtractPoints);
REGISTER_PARAMETER(Real, PID_PointSize);
REGISTER_PARAMETER(Real, PID_MaxVectorSize);
REGISTER_PARAMETER(Int, PID_NumElements);

// Register custom Parameters specific to Analysis Situs.
this->registerParameter(PID_Octree, asiData_OctreeParameter::Instance(), false);
this->registerParameter(PID_BVH, asiData_BVHParameter ::Instance(), false);
this->registerParameter(PID_Octree, asiData_OctreeParameter ::Instance(), false);
}

//-----------------------------------------------------------------------------
Expand All @@ -81,6 +86,7 @@ Handle(ActAPI_INode) asiData_OctreeNode::Instance()
void asiData_OctreeNode::Init()
{
// Set default values.
this->SetBVH (nullptr);
this->SetOctree (nullptr);
this->SetMinCellSize (1.);
this->SetMaxCellSize (100.);
Expand All @@ -90,6 +96,7 @@ void asiData_OctreeNode::Init()
this->SetDomainCube (false);
this->SetSamplingStrategy (0x01 | 0x02 | 0x04);
this->SetExtractPoints (false);
this->SetPointSize (1.);
this->SetMaxVectorSize (1.);
this->SetNumElements (0);

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

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

//-----------------------------------------------------------------------------

void asiData_OctreeNode::SetBVH(const Handle(asiAlgo_BVHFacets)& bvhFacets)
{
Handle(asiData_BVHParameter)::DownCast( this->Parameter(PID_BVH) )->SetBVH(bvhFacets);
}

//-----------------------------------------------------------------------------

Handle(asiAlgo_BVHFacets) asiData_OctreeNode::GetBVH() const
{
return Handle(asiData_BVHParameter)::DownCast( this->Parameter(PID_BVH) )->GetBVH();
}

//-----------------------------------------------------------------------------

void* asiData_OctreeNode::GetOctree() const
{
return Handle(asiData_OctreeParameter)::DownCast( this->Parameter(PID_Octree) )->GetOctree();
Expand Down Expand Up @@ -176,6 +198,20 @@ void asiData_OctreeNode::SetExtractPoints(const bool toExtract)

//-----------------------------------------------------------------------------

double asiData_OctreeNode::GetPointSize() const
{
return ActParamTool::AsReal( this->Parameter(PID_PointSize) )->GetValue();
}

//-----------------------------------------------------------------------------

void asiData_OctreeNode::SetPointSize(const double size)
{
ActParamTool::AsReal( this->Parameter(PID_PointSize) )->SetValue(size);
}

//-----------------------------------------------------------------------------

double asiData_OctreeNode::GetMaxVectorSize() const
{
return ActParamTool::AsReal( this->Parameter(PID_MaxVectorSize) )->GetValue();
Expand Down
Loading

0 comments on commit 2b2cc9d

Please sign in to comment.