static int MYDEBUG1 = 0;
static int MYDEBUG2 = 0;
#endif
-
+//modified by NIZNHY-PKV Tue Oct 4 16:00:12 2005f
+static float s_Radius=0;
+//modified by NIZNHY-PKV Tue Oct 4 16:00:15 2005t
//----------------------------------------------------------------
vtkStandardNewMacro( VISU_OutsideCursorSettings );
vtkStandardNewMacro( VISU_PickingSettings );
}
//
vtkIdType aVtkId = myPointPicker->GetPointId();
+ printf(" * Highlight() aVtkId=%d\n", aVtkId);
if( aVtkId >= 0 && theSelector->IsValid( this, aVtkId, true ) && hasIO()) {
vtkIdType anObjId = GetNodeObjId( aVtkId );
if(anObjId >= 0){
if(vtkDataArray* aScalarArray = aCellData->GetScalars()){
float aVal = aScalarArray->GetTuple1(aVtkId);
float aRadius = myGaussPointsPL->GetPointSize(aVtkId, aScalarArray);
+ //modified by NIZNHY-PKV Tue Oct 4 16:00:45 2005f
+ s_Radius=aRadius;
+ //modified by NIZNHY-PKV Tue Oct 4 16:00:47 2005t
mySphereSourceSelected->SetRadius(aRadius);
//
if(theSelector->HasIndex(myIO)){
//mySphereActor->SetVisibility(aSphereVisibility);
return bRet;
}
-
+//==================================================================
+// function : highlight
+// purpose :
+//==================================================================
+void VISU_GaussPtsAct::highlight(bool theHighlight,
+ SVTK_Selector* theSelector)
+{
+ Superclass::highlight(theHighlight, theSelector);
+ //
+ TColStd_IndexedMapOfInteger aMapIndex;
+ theSelector->GetIndex( getIO(), aMapIndex );
+ int aNbOfParts = aMapIndex.Extent();
+ if (!aNbOfParts){
+ mySphereActorSelected->SetVisibility(0);
+ }
+ else if (aNbOfParts==1){
+ int anObjId = aMapIndex(1);
+ vtkIdType aVtkId;
+ float* aNodeCoord = GetNodeCoord(anObjId);
+ printf(" *highlight() anObjId=%d { %f, %f, %f }\n",
+ anObjId, aNodeCoord[0], aNodeCoord[1], aNodeCoord[2]);
+ mySphereSourceSelected->SetCenter(aNodeCoord);
+ //mySphereSourceSelected->SetRadius(s_Radius);
+ //
+
+ aVtkId=myGaussPointsPL->GetElemVTKID(anObjId);
+ printf(" aVtkId=%d\n", aVtkId);
+ vtkDataSet* aDataSet = GetInput();
+ vtkCellData* aCellData = aDataSet->GetCellData();
+ if(vtkDataArray* aScalarArray = aCellData->GetScalars()){
+ float aVal = aScalarArray->GetTuple1(aVtkId);
+ float aRadius = myGaussPointsPL->GetPointSize(aVtkId, aScalarArray);
+ mySphereSourceSelected->SetRadius(aRadius);
+ //
+ GetScalarBarCtrl()->SetMarkValue(aVal);
+ }
+
+ mySphereActorSelected->SetVisibility(1);
+ }
+}
//----------------------------------------------------------------
void
VISU_GaussPtsAct
{
return myStoreMapping;
}
+//modified by NIZNHY-PKV Tue Oct 4 16:52:22 2005f
+//----------------------------------------------------------------------------
+vtkIdType
+SALOME_ExtractGeometry
+::GetElemVTKId(int theObjID)
+{
+ if (myElemVTK2ObjIds.empty())
+ return theObjID;
+
+ int i, aNb;
+ vtkIdType anObjId, aVTKId=-1;
+ //
+ aNb=myElemVTK2ObjIds.size();
+ for (i=0; i<aNb; ++i){
+#if defined __GNUC_2__
+ anObjId=myElemVTK2ObjIds[i];
+#else
+ anObjId=myElemVTK2ObjIds.at(i);
+#endif
+ if (anObjId==theObjID){
+ aVTKId=i;
+ return aVTKId;
+ }
+ }
+ return aVTKId;
+}
+vtkIdType
+SALOME_ExtractGeometry
+::GetNodeVTKId(int theObjID)
+{
+ if (myNodeVTK2ObjIds.empty())
+ return theObjID;
+
+ int i, aNb;
+ vtkIdType anObjId, aVTKId=-1;
+ //
+ aNb=myNodeVTK2ObjIds.size();
+ for (i=0; i<aNb; ++i){
+#if defined __GNUC_2__
+ anObjId=myNodeVTK2ObjIds[i];
+#else
+ anObjId=myNodeVTK2ObjIds.at(i);
+#endif
+ if (anObjId==theObjID){
+ aVTKId=i;
+ return aVTKId;
+ }
+ }
+ return aVTKId;
+}
+//modified by NIZNHY-PKV Tue Oct 4 16:52:24 2005t
//----------------------------------------------------------------------------
vtkIdType