Salome HOME
projects
/
modules
/
gui.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Upgrade to paraview 5.4
[modules/gui.git]
/
src
/
VTKViewer
/
VTKViewer_Actor.cxx
diff --git
a/src/VTKViewer/VTKViewer_Actor.cxx
b/src/VTKViewer/VTKViewer_Actor.cxx
index fc8eda9a24e9b969a88d985043190dbd70f2bb7b..76f5d153bde1b9a64534a216f774c4ab2b6b0c82 100755
(executable)
--- a/
src/VTKViewer/VTKViewer_Actor.cxx
+++ b/
src/VTKViewer/VTKViewer_Actor.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
2
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
6
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-6,7
+6,7
@@
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License
, or (at your option) any later version
.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-61,18
+61,18
@@
vtkStandardNewMacro(VTKViewer_Actor);
*/
VTKViewer_Actor
::VTKViewer_Actor():
*/
VTKViewer_Actor
::VTKViewer_Actor():
+ myIsResolveCoincidentTopology(true),
myOpacity(1.0),
myOpacity(1.0),
- myIsHighlighted(false),
- myIsPreselected(false),
- myRepresentation(VTKViewer::Representation::Surface),
myDisplayMode(1),
myDisplayMode(1),
- myProperty(vtkProperty::New()),
- PreviewProperty(NULL),
myIsInfinite(false),
myIsInfinite(false),
- myIsResolveCoincidentTopology(true),
myStoreMapping(false),
myGeomFilter(VTKViewer_GeometryFilter::New()),
myStoreMapping(false),
myGeomFilter(VTKViewer_GeometryFilter::New()),
- myTransformFilter(VTKViewer_TransformFilter::New())
+ myTransformFilter(VTKViewer_TransformFilter::New()),
+ myRepresentation(VTKViewer::Representation::Surface),
+ myProperty(vtkProperty::New()),
+ PreviewProperty(NULL),
+ myIsPreselected(false),
+ myIsHighlighted(false)
{
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
myPolygonOffsetUnits);
{
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
myPolygonOffsetUnits);
@@
-180,30
+180,26
@@
VTKViewer_Actor
{
if(theMapper){
int anId = 0;
{
if(theMapper){
int anId = 0;
- myPassFilter[ anId ]->SetInput( theMapper->GetInput() );
- myPassFilter[ anId + 1]->SetInput
( myPassFilter[ anId ]->GetOutpu
t() );
+ myPassFilter[ anId ]->SetInput
Data
( theMapper->GetInput() );
+ myPassFilter[ anId + 1]->SetInput
Connection( myPassFilter[ anId ]->GetOutputPor
t() );
anId++; // 1
myGeomFilter->SetStoreMapping( myStoreMapping );
anId++; // 1
myGeomFilter->SetStoreMapping( myStoreMapping );
- myGeomFilter->SetInput
( myPassFilter[ anId ]->GetOutpu
t() );
+ myGeomFilter->SetInput
Connection( myPassFilter[ anId ]->GetOutputPor
t() );
anId++; // 2
anId++; // 2
- myPassFilter[ anId ]->SetInput
( myGeomFilter->GetOutpu
t() );
- myPassFilter[ anId + 1 ]->SetInput
( myPassFilter[ anId ]->GetOutpu
t() );
+ myPassFilter[ anId ]->SetInput
Connection( myGeomFilter->GetOutputPor
t() );
+ myPassFilter[ anId + 1 ]->SetInput
Connection( myPassFilter[ anId ]->GetOutputPor
t() );
anId++; // 3
anId++; // 3
- myTransformFilter->SetInput
( myPassFilter[ anId ]->GetPolyDataOutpu
t() );
+ myTransformFilter->SetInput
Connection( myPassFilter[ anId ]->GetOutputPor
t() );
anId++; // 4
anId++; // 4
- myPassFilter[ anId ]->SetInput
( myTransformFilter->GetOutpu
t() );
- myPassFilter[ anId + 1 ]->SetInput
( myPassFilter[ anId ]->GetOutpu
t() );
+ myPassFilter[ anId ]->SetInput
Connection( myTransformFilter->GetOutputPor
t() );
+ myPassFilter[ anId + 1 ]->SetInput
Connection( myPassFilter[ anId ]->GetOutputPor
t() );
anId++; // 5
anId++; // 5
- if(vtkDataSetMapper* aMapper = dynamic_cast<vtkDataSetMapper*>(theMapper)){
- aMapper->SetInput(myPassFilter[anId]->GetOutput());
- }else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper)){
- aMapper->SetInput(myPassFilter[anId]->GetPolyDataOutput());
- }
+ theMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
}
Superclass::SetMapper(theMapper);
}
}
Superclass::SetMapper(theMapper);
}
@@
-216,15
+212,15
@@
VTKViewer_Actor
::Render(vtkRenderer *ren, vtkMapper* m)
{
if(vtkDataSet* aDataSet = GetInput()){
::Render(vtkRenderer *ren, vtkMapper* m)
{
if(vtkDataSet* aDataSet = GetInput()){
- static
vtkFloatingPointTyp
e PERCENTS_OF_DETAILS = 0.50;
+ static
doubl
e PERCENTS_OF_DETAILS = 0.50;
vtkIdType aNbOfPoints = vtkIdType(aDataSet->GetNumberOfPoints()*PERCENTS_OF_DETAILS);
if(aNbOfPoints > 0)
SetNumberOfCloudPoints(aNbOfPoints);
}
vtkIdType aNbOfPoints = vtkIdType(aDataSet->GetNumberOfPoints()*PERCENTS_OF_DETAILS);
if(aNbOfPoints > 0)
SetNumberOfCloudPoints(aNbOfPoints);
}
+ int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology();
if(myIsResolveCoincidentTopology){
if(myIsResolveCoincidentTopology){
- int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology();
- vtkFloatingPointType aFactor, aUnit;
+ double aFactor, aUnit;
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
@@
-233,10
+229,11
@@
VTKViewer_Actor
Superclass::Render(ren,m);
vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
Superclass::Render(ren,m);
vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
- vtkMapper::SetResolveCoincidentTopology(aResolveCoincidentTopology);
}else{
}else{
+ vtkMapper::SetResolveCoincidentTopologyToOff();
Superclass::Render(ren,m);
}
Superclass::Render(ren,m);
}
+ vtkMapper::SetResolveCoincidentTopology(aResolveCoincidentTopology);
}
/*!
}
/*!
@@
-256,8
+253,8
@@
VTKViewer_Actor
*/
void
VTKViewer_Actor
*/
void
VTKViewer_Actor
-::SetPolygonOffsetParameters(
vtkFloatingPointTyp
e factor,
-
vtkFloatingPointTyp
e units)
+::SetPolygonOffsetParameters(
doubl
e factor,
+
doubl
e units)
{
myPolygonOffsetFactor = factor;
myPolygonOffsetUnits = units;
{
myPolygonOffsetFactor = factor;
myPolygonOffsetUnits = units;
@@
-269,8
+266,8
@@
VTKViewer_Actor
*/
void
VTKViewer_Actor
*/
void
VTKViewer_Actor
-::GetPolygonOffsetParameters(
vtkFloatingPointTyp
e& factor,
-
vtkFloatingPointTyp
e& units)
+::GetPolygonOffsetParameters(
doubl
e& factor,
+
doubl
e& units)
{
factor = myPolygonOffsetFactor;
units = myPolygonOffsetUnits;
{
factor = myPolygonOffsetFactor;
units = myPolygonOffsetUnits;
@@
-279,7
+276,7
@@
VTKViewer_Actor
/*!
\return shrink factor
*/
/*!
\return shrink factor
*/
-
vtkFloatingPointTyp
e
+
doubl
e
VTKViewer_Actor
::GetShrinkFactor()
{
VTKViewer_Actor
::GetShrinkFactor()
{
@@
-335,12
+332,12
@@
VTKViewer_Actor
/*!
To calculatate last modified time
*/
/*!
To calculatate last modified time
*/
-unsigned long int
+vtkMTimeType
VTKViewer_Actor
::GetMTime()
{
VTKViewer_Actor
::GetMTime()
{
-
unsigned long
mTime = this->Superclass::GetMTime();
-
unsigned long
time = myTransformFilter->GetMTime();
+
vtkMTimeType
mTime = this->Superclass::GetMTime();
+
vtkMTimeType
time = myTransformFilter->GetMTime();
mTime = ( time > mTime ? time : mTime );
if(vtkDataSet *aDataSet = dynamic_cast<vtkDataSet*>(myPassFilter[0]->GetInput())){ // bad usage of GetInput
time = aDataSet->GetMTime();
mTime = ( time > mTime ? time : mTime );
if(vtkDataSet *aDataSet = dynamic_cast<vtkDataSet*>(myPassFilter[0]->GetInput())){ // bad usage of GetInput
time = aDataSet->GetMTime();
@@
-433,7
+430,7
@@
VTKViewer_Actor
/*!
Get coordinates of a node for given object index
*/
/*!
Get coordinates of a node for given object index
*/
-
vtkFloatingPointTyp
e*
+
doubl
e*
VTKViewer_Actor
::GetNodeCoord(int theObjID)
{
VTKViewer_Actor
::GetNodeCoord(int theObjID)
{
@@
-494,14
+491,14
@@
VTKViewer_Actor
if(myIsInfinite)
return true;
if(myIsInfinite)
return true;
- static
vtkFloatingPointType MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT
;
-
vtkFloatingPointTyp
e aBounds[6];
+ static
double MAX_DISTANCE = 0.9*VTK_FLOAT_MAX
;
+
doubl
e aBounds[6];
GetBounds(aBounds);
for(int i = 0; i < 6; i++)
if(fabs(aBounds[i]) > MAX_DISTANCE)
return true;
GetBounds(aBounds);
for(int i = 0; i < 6; i++)
if(fabs(aBounds[i]) > MAX_DISTANCE)
return true;
- static
vtkFloatingPointType MIN_DISTANCE = 1.0/VTK_LARGE_FLOAT
;
+ static
double MIN_DISTANCE = 1.0/VTK_FLOAT_MAX
;
if(GetLength() < MIN_DISTANCE)
return true;
if(GetLength() < MIN_DISTANCE)
return true;
@@
-511,7
+508,7
@@
VTKViewer_Actor
/*!
\return current bounding box
*/
/*!
\return current bounding box
*/
-
vtkFloatingPointTyp
e*
+
doubl
e*
VTKViewer_Actor
::GetBounds()
{
VTKViewer_Actor
::GetBounds()
{
@@
-524,7
+521,7
@@
VTKViewer_Actor
*/
void
VTKViewer_Actor
*/
void
VTKViewer_Actor
-::GetBounds(
vtkFloatingPointTyp
e theBounds[6])
+::GetBounds(
doubl
e theBounds[6])
{
Superclass::GetBounds(theBounds);
}
{
Superclass::GetBounds(theBounds);
}
@@
-546,7
+543,7
@@
VTKViewer_Actor
void
VTKViewer_Actor
void
VTKViewer_Actor
-::SetSize( const
vtkFloatingPointTyp
e )
+::SetSize( const
doubl
e )
{}
{}
@@
-558,13
+555,13
@@
VTKViewer_Actor
void
VTKViewer_Actor
void
VTKViewer_Actor
-::SetOpacity(
vtkFloatingPointTyp
e theOpacity)
+::SetOpacity(
doubl
e theOpacity)
{
myOpacity = theOpacity;
GetProperty()->SetOpacity(theOpacity);
}
{
myOpacity = theOpacity;
GetProperty()->SetOpacity(theOpacity);
}
-
vtkFloatingPointTyp
e
+
doubl
e
VTKViewer_Actor
::GetOpacity()
{
VTKViewer_Actor
::GetOpacity()
{
@@
-577,9
+574,9
@@
VTKViewer_Actor
*/
void
VTKViewer_Actor
*/
void
VTKViewer_Actor
-::SetColor(
vtkFloatingPointTyp
e r,
-
vtkFloatingPointTyp
e g,
-
vtkFloatingPointTyp
e b)
+::SetColor(
doubl
e r,
+
doubl
e g,
+
doubl
e b)
{
GetProperty()->SetColor(r,g,b);
}
{
GetProperty()->SetColor(r,g,b);
}
@@
-589,7
+586,7
@@
VTKViewer_Actor
*/
void
VTKViewer_Actor
*/
void
VTKViewer_Actor
-::SetColor(const
vtkFloatingPointTyp
e theRGB[3])
+::SetColor(const
doubl
e theRGB[3])
{
SetColor(theRGB[0],theRGB[1],theRGB[2]);
}
{
SetColor(theRGB[0],theRGB[1],theRGB[2]);
}
@@
-599,11
+596,11
@@
VTKViewer_Actor
*/
void
VTKViewer_Actor
*/
void
VTKViewer_Actor
-::GetColor(
vtkFloatingPointTyp
e& r,
-
vtkFloatingPointTyp
e& g,
-
vtkFloatingPointTyp
e& b)
+::GetColor(
doubl
e& r,
+
doubl
e& g,
+
doubl
e& b)
{
{
-
vtkFloatingPointTyp
e aColor[3];
+
doubl
e aColor[3];
GetProperty()->GetColor(aColor);
r = aColor[0];
g = aColor[1];
GetProperty()->GetColor(aColor);
r = aColor[0];
g = aColor[1];
@@
-728,14
+725,14
@@
bool VTKViewer_Actor::GetQuadraticArcMode() const{
/*!
* Set Max angle for representation 2D quadratic element as arked polygon
*/
/*!
* Set Max angle for representation 2D quadratic element as arked polygon
*/
-void VTKViewer_Actor::SetQuadraticArcAngle(
vtkFloatingPointTyp
e theMaxAngle){
+void VTKViewer_Actor::SetQuadraticArcAngle(
doubl
e theMaxAngle){
myGeomFilter->SetQuadraticArcAngle(theMaxAngle);
}
/*!
* Return Max angle of the representation 2D quadratic element as arked polygon
*/
myGeomFilter->SetQuadraticArcAngle(theMaxAngle);
}
/*!
* Return Max angle of the representation 2D quadratic element as arked polygon
*/
-
vtkFloatingPointTyp
e VTKViewer_Actor::GetQuadraticArcAngle() const{
+
doubl
e VTKViewer_Actor::GetQuadraticArcAngle() const{
return myGeomFilter->GetQuadraticArcAngle();
}
return myGeomFilter->GetQuadraticArcAngle();
}