Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bill Lorensen
VTK
Commits
bc2c8f4e
Commit
bc2c8f4e
authored
Mar 20, 2012
by
Dave DeMarle
Browse files
Merge branch 'RenameBooleanOperation-rel' into release
Change-Id: I8254a4b4315d09cc1d29ab28d14b3d68e77bf6a2
parents
e06e6531
d856f10a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Graphics/Testing/Cxx/TestBooleanOperationPolyDataFilter.cxx
View file @
bc2c8f4e
...
...
@@ -63,17 +63,17 @@ int TestBooleanOperationPolyDataFilter(int, char *[])
renWinInteractor
->
SetRenderWindow
(
renWin
);
vtkActor
*
unionActor
=
GetBooleanOperationActor
(
-
2.0
,
vtkBooleanOperationPolyDataFilter
::
UNION
);
GetBooleanOperationActor
(
-
2.0
,
vtkBooleanOperationPolyDataFilter
::
VTK_
UNION
);
renderer
->
AddActor
(
unionActor
);
unionActor
->
Delete
();
vtkActor
*
intersectionActor
=
GetBooleanOperationActor
(
0.0
,
vtkBooleanOperationPolyDataFilter
::
INTERSECTION
);
GetBooleanOperationActor
(
0.0
,
vtkBooleanOperationPolyDataFilter
::
VTK_
INTERSECTION
);
renderer
->
AddActor
(
intersectionActor
);
intersectionActor
->
Delete
();
vtkActor
*
differenceActor
=
GetBooleanOperationActor
(
2.0
,
vtkBooleanOperationPolyDataFilter
::
DIFFERENCE
);
GetBooleanOperationActor
(
2.0
,
vtkBooleanOperationPolyDataFilter
::
VTK_
DIFFERENCE
);
renderer
->
AddActor
(
differenceActor
);
differenceActor
->
Delete
();
...
...
Graphics/Testing/Cxx/TestBooleanOperationPolyDataFilter2.cxx
View file @
bc2c8f4e
...
...
@@ -62,12 +62,12 @@ static vtkActor* GetBooleanOperationActor( double x, int operation )
(
0
,
0
,
0
,
vtkDataObject
::
FIELD_ASSOCIATION_CELLS
,
"Distance"
);
thresh2
->
SetInputConnection
(
distance
->
GetOutputPort
(
1
)
);
if
(
operation
==
vtkBooleanOperationPolyDataFilter
::
UNION
)
if
(
operation
==
vtkBooleanOperationPolyDataFilter
::
VTK_
UNION
)
{
thresh1
->
ThresholdByUpper
(
0.0
);
thresh2
->
ThresholdByUpper
(
0.0
);
}
else
if
(
operation
==
vtkBooleanOperationPolyDataFilter
::
INTERSECTION
)
else
if
(
operation
==
vtkBooleanOperationPolyDataFilter
::
VTK_
INTERSECTION
)
{
thresh1
->
ThresholdByLower
(
0.0
);
thresh2
->
ThresholdByLower
(
0.0
);
...
...
@@ -132,17 +132,17 @@ int TestBooleanOperationPolyDataFilter2(int, char *[])
renWinInteractor
->
SetRenderWindow
(
renWin
);
vtkActor
*
unionActor
=
GetBooleanOperationActor
(
-
2.0
,
vtkBooleanOperationPolyDataFilter
::
UNION
);
GetBooleanOperationActor
(
-
2.0
,
vtkBooleanOperationPolyDataFilter
::
VTK_
UNION
);
renderer
->
AddActor
(
unionActor
);
unionActor
->
Delete
();
vtkActor
*
intersectionActor
=
GetBooleanOperationActor
(
0.0
,
vtkBooleanOperationPolyDataFilter
::
INTERSECTION
);
GetBooleanOperationActor
(
0.0
,
vtkBooleanOperationPolyDataFilter
::
VTK_
INTERSECTION
);
renderer
->
AddActor
(
intersectionActor
);
intersectionActor
->
Delete
();
vtkActor
*
differenceActor
=
GetBooleanOperationActor
(
2.0
,
vtkBooleanOperationPolyDataFilter
::
DIFFERENCE
);
GetBooleanOperationActor
(
2.0
,
vtkBooleanOperationPolyDataFilter
::
VTK_
DIFFERENCE
);
renderer
->
AddActor
(
differenceActor
);
differenceActor
->
Delete
();
...
...
Graphics/vtkBooleanOperationPolyDataFilter.cxx
View file @
bc2c8f4e
...
...
@@ -33,7 +33,7 @@ vtkBooleanOperationPolyDataFilter::vtkBooleanOperationPolyDataFilter() :
vtkPolyDataAlgorithm
()
{
this
->
Tolerance
=
1e-6
;
this
->
Operation
=
UNION
;
this
->
Operation
=
VTK_
UNION
;
this
->
ReorientDifferenceCells
=
1
;
this
->
SetNumberOfInputPorts
(
2
);
...
...
@@ -155,12 +155,12 @@ int vtkBooleanOperationPolyDataFilter::RequestData(vtkInformation* vtkNot
outputSurface
->
GetPointData
()
->
CopyAllocate
(
pointFields
);
outputSurface
->
GetCellData
()
->
CopyAllocate
(
cellFields
);
if
(
this
->
Operation
==
UNION
||
this
->
Operation
==
DIFFERENCE
)
if
(
this
->
Operation
==
VTK_
UNION
||
this
->
Operation
==
VTK_
DIFFERENCE
)
{
this
->
CopyCells
(
pd0
,
outputSurface
,
0
,
pointFields
,
cellFields
,
unionList
,
false
);
}
else
if
(
this
->
Operation
==
INTERSECTION
)
else
if
(
this
->
Operation
==
VTK_
INTERSECTION
)
{
this
->
CopyCells
(
pd0
,
outputSurface
,
0
,
pointFields
,
cellFields
,
interList
,
false
);
...
...
@@ -192,16 +192,16 @@ int vtkBooleanOperationPolyDataFilter::RequestData(vtkInformation* vtkNot
this
->
SortPolyData
(
pd1
,
interList
,
unionList
);
if
(
this
->
Operation
==
UNION
)
if
(
this
->
Operation
==
VTK_
UNION
)
{
this
->
CopyCells
(
pd1
,
outputSurface
,
1
,
pointFields
,
cellFields
,
unionList
,
false
);
}
else
if
(
this
->
Operation
==
INTERSECTION
||
this
->
Operation
==
DIFFERENCE
)
else
if
(
this
->
Operation
==
VTK_
INTERSECTION
||
this
->
Operation
==
VTK_
DIFFERENCE
)
{
this
->
CopyCells
(
pd1
,
outputSurface
,
1
,
pointFields
,
cellFields
,
interList
,
(
this
->
ReorientDifferenceCells
==
1
&&
this
->
Operation
==
DIFFERENCE
));
this
->
Operation
==
VTK_
DIFFERENCE
));
}
vtkIdType
i
;
...
...
@@ -238,15 +238,15 @@ void vtkBooleanOperationPolyDataFilter::PrintSelf(ostream& os, vtkIndent indent)
os
<<
indent
<<
"Operation: "
;
switch
(
this
->
Operation
)
{
case
UNION
:
case
VTK_
UNION
:
os
<<
"UNION"
;
break
;
case
INTERSECTION
:
case
VTK_
INTERSECTION
:
os
<<
"INTERSECTION"
;
break
;
case
DIFFERENCE
:
case
VTK_
DIFFERENCE
:
os
<<
"DIFFERENCE"
;
break
;
}
...
...
Graphics/vtkBooleanOperationPolyDataFilter.h
View file @
bc2c8f4e
...
...
@@ -52,21 +52,21 @@ public:
enum
OperationType
{
UNION
=
0
,
INTERSECTION
,
DIFFERENCE
VTK_
UNION
=
0
,
VTK_
INTERSECTION
,
VTK_
DIFFERENCE
};
// Description:
// Set the boolean operation to perform. Defaults to union.
vtkSetClampMacro
(
Operation
,
int
,
UNION
,
DIFFERENCE
);
vtkSetClampMacro
(
Operation
,
int
,
VTK_
UNION
,
VTK_
DIFFERENCE
);
vtkGetMacro
(
Operation
,
int
);
void
SetOperationToUnion
()
{
this
->
SetOperation
(
UNION
);
}
{
this
->
SetOperation
(
VTK_
UNION
);
}
void
SetOperationToIntersection
()
{
this
->
SetOperation
(
INTERSECTION
);
}
{
this
->
SetOperation
(
VTK_
INTERSECTION
);
}
void
SetOperationToDifference
()
{
this
->
SetOperation
(
DIFFERENCE
);
}
{
this
->
SetOperation
(
VTK_
DIFFERENCE
);
}
// Description:
// Turn on/off cell reorientation of the intersection portion of the
...
...
@@ -112,7 +112,8 @@ private:
double
Tolerance
;
// Description:
// Which operation to perform. Can be UNION, INTERSECTION, or DIFFERENCE.
// Which operation to perform.
// Can be VTK_UNION, VTK_INTERSECTION, or VTK_DIFFERENCE.
int
Operation
;
// Description:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment