Skip to content

Commit

Permalink
start enum at 1
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-laurin committed Jul 15, 2020
1 parent 6239228 commit 529febf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
19 changes: 15 additions & 4 deletions Plugins/Libigl/stkLibiglCopyleft/stkLibiglBoolean3DMesher.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,25 @@ int stkLibiglBoolean3DMesher::RequestData(vtkInformation *,
Eigen::MatrixXi outputMeshCells;
try
{
if (this->Mode >= Modes::UNION && this->Mode <= Modes::DIFFERENCE)
{
if (this->Mode == stkLibiglBoolean3DMesher::Modes::UNION) {
igl::copyleft::cgal::mesh_boolean(inputMeshAVerts, inputMeshACells,
inputMeshBVerts, inputMeshBCells,
igl::MeshBooleanType::MESH_BOOLEAN_TYPE_UNION,
outputMeshVerts, outputMeshCells);
}
else if (this->Mode == stkLibiglBoolean3DMesher::Modes::INTERSECTION) {
igl::copyleft::cgal::mesh_boolean(inputMeshAVerts, inputMeshACells,
inputMeshBVerts, inputMeshBCells,
static_cast<igl::MeshBooleanType>(this->Mode),
igl::MeshBooleanType::MESH_BOOLEAN_TYPE_INTERSECT,
outputMeshVerts, outputMeshCells);
}
else if (this->Mode == stkLibiglBoolean3DMesher::Modes::DIFFERENCE) {
igl::copyleft::cgal::mesh_boolean(inputMeshAVerts, inputMeshACells,
inputMeshBVerts, inputMeshBCells,
igl::MeshBooleanType::MESH_BOOLEAN_TYPE_MINUS,
outputMeshVerts, outputMeshCells);
}
else if (this->Mode == Modes::DIFFERENCE2)
else if (this->Mode == stkLibiglBoolean3DMesher::Modes::DIFFERENCE2)
{
igl::copyleft::cgal::mesh_boolean(inputMeshBVerts, inputMeshBCells,
inputMeshAVerts, inputMeshACells,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class STKLIBIGLCOPYLEFT_EXPORT stkLibiglBoolean3DMesher : public vtkPolyDataAlgo
vtkPolyData* GetInputMeshB();

enum Modes {
UNION = 0,
UNION = 1,
INTERSECTION,
DIFFERENCE,
DIFFERENCE2
Expand Down
8 changes: 4 additions & 4 deletions Plugins/Libigl/stkLibiglCopyleft/stkLibiglCopyleftPlugins.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

<IntVectorProperty name="Mode" command="SetMode" number_of_elements="1" default_values="0">
<EnumerationDomain name="enum">
<Entry value="0" text="Union"/>
<Entry value="1" text="Intersection"/>
<Entry value="2" text="Difference"/>
<Entry value="3" text="Difference2"/>
<Entry value="1" text="Union"/>
<Entry value="2" text="Intersection"/>
<Entry value="3" text="Difference"/>
<Entry value="4" text="Difference2"/>
</EnumerationDomain>
<Documentation>
Set the boolean operation to perform.
Expand Down

0 comments on commit 529febf

Please sign in to comment.