-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 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
//
-// 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.
+// 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.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
// Module : VISU
-
+//
#include "VISU_Actor.h"
#include "VISU_ActorFactory.h"
#include "VISU_SelectVisiblePoints.h"
#include "VISU_PipeLine.hxx"
+#include "VISU_UsedPointsFilter.hxx"
#include "SVTK_Actor.h"
#include "SVTK_Event.h"
+#include "VTKViewer_CellCenters.h"
#include "VTKViewer_FramedTextActor.h"
#include "VTKViewer_ShrinkFilter.h"
#include "VTKViewer_GeometryFilter.h"
#include <stdexcept>
#include <sstream>
+#include <cmath> // to use std::abs( int )
// VTK Includes
#include <vtkProperty.h>
myValLblDataSet = vtkUnstructuredGrid::New();
- myValCellCenters = vtkCellCenters::New();
+ myValCellCenters = VTKViewer_CellCenters::New();
myValCellCenters->SetInput(myValLblDataSet);
+ myValUsedPoints = VISU_UsedPointsFilter::New();
+ myValUsedPoints->SetInput(myValLblDataSet);
+
myValMaskPoints = vtkMaskPoints::New();
myValMaskPoints->SetInput(myValCellCenters->GetOutput());
myValMaskPoints->SetOnRatio(1);
char aFormat[16] = "%g";
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
if (aResourceMgr) {
- int aFloatingPrec = aResourceMgr->integerValue("VISU", "floating_point_precision", 6);
+ // san: precision can be negative - this is used by double spin boxes
+ int aFloatingPrec = std::abs( aResourceMgr->integerValue("VISU", "visual_data_precision", 6) );
sprintf(aFormat, "%%.%dg", aFloatingPrec);
//cout << "$$$ aFormat = " << aFormat << endl;
}
myValLabeledDataMapper->Delete();
myValSelectVisiblePoints->Delete();
myValMaskPoints->Delete();
+ myValUsedPoints->Delete();
myValCellCenters->Delete();
myValLabels->Delete();
{
UnShrink();
}
- SetFeatureEdgesEnabled( theMode == SVTK::Representation::FeatureEdges );
+ SetFeatureEdgesEnabled( theMode == VTKViewer::Representation::FeatureEdges );
}
{
if( mySelectionMode == ActorSelection )
ResetTextActor();
- else
- aShowTextActor = false;
myLastSelectionMode = mySelectionMode;
}
- myTextActor->SetVisibility( GetVisibility() && theIsHighlight && aShowTextActor );
+ myTextActor->SetVisibility( GetVisibility() && theIsHighlight && aShowTextActor &&
+ ( mySelectionMode == ActorSelection || isSubElementsHighlighted() ) );
bool anInitialHasIndex = isHighlighted();
bool aCurrentHasIndex = theIsHighlight;
myValMaskPoints->SetInput( myValCellCenters->GetOutput() );
}
else if ( isOnPnt )
- myValMaskPoints->SetInput( aDataSet );
+ {
+ myValUsedPoints->SetInput( aDataSet );
+ myValMaskPoints->SetInput( myValUsedPoints->GetOutput() );
+ }
myValLabels->SetVisibility( GetVisibility() );
}