this->EdgesProperty->SetAmbientColor(1.0,1.0,1.0);
}
//==================================================================
+// function: InitialPlaceWidget
+// purpose :
+//==================================================================
+void VISU_ImplicitFunctionWidget::InitialPlaceWidget(float bds[6])
+{
+ float bounds[6], origin[3];
+
+ PlaceWidget(bds);
+ //
+ this->AdjustBounds(bds, bounds, origin);
+ this->SetOrigin((bounds[1]+bounds[0])/2.0,
+ (bounds[3]+bounds[2])/2.0,
+ (bounds[5]+bounds[4])/2.0);
+
+ static float DIST_COEFF = 0.1;
+ SetDistance(this->InitialLength*DIST_COEFF);
+ //
+ this->UpdateRepresentation();
+}
+//==================================================================
// function: PlaceWidget
// purpose :
//==================================================================
myPlane2->SetNormal(-1,0,0);
this->LineSource->SetPoint2(1,0,0);
}
- }
+ }
for (i=0; i<6; i++) {
this->InitialBounds[i] = bounds[i];
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
- this->SetOrigin((bounds[1]+bounds[0])/2.0,
- (bounds[3]+bounds[2])/2.0,
- (bounds[5]+bounds[4])/2.0);
-
- static float DIST_COEFF = 0.1;
- SetDistance(this->InitialLength*DIST_COEFF);
-
this->UpdateRepresentation();
}
//==================================================================
// applies to the edges when tubed.)
vtkGetObjectMacro(EdgesProperty,vtkProperty);
+ void InitialPlaceWidget(float bds[6]);
+
protected:
VISU_ImplicitFunctionWidget();
~VISU_ImplicitFunctionWidget();
anActor->SetImplicitFunctionWidget(GetImplicitFunctionWidget());
anActor->SetOutsideCursorSettings(myOutsideCursorSettings);
Superclass::AddActor(anActor);
+ AdjustImplicitFunctionWidget();
}
}
anActor->SetImplicitFunctionWidget(NULL);
anActor->SetOutsideCursorSettings(NULL);
Superclass::RemoveActor(theActor);
+ AdjustImplicitFunctionWidget();
+ }
+}
+//----------------------------------------------------------------------------
+void VVTK_Renderer1::AdjustImplicitFunctionWidget()
+{
+ if(SVTK_Renderer::OnAdjustActors()){
+ myImplicitFunctionWidget->InitialPlaceWidget(myBndBox);
+ myImplicitFunctionWidget->SetOrigin((myBndBox[1] + myBndBox[0]) / 2.0,
+ (myBndBox[3] + myBndBox[2]) / 2.0,
+ (myBndBox[5] + myBndBox[4]) / 2.0);
+ myImplicitFunctionWidget->SetHandleSize(myImplicitFunctionWidget->GetHandleSize());
}
}
-
//----------------------------------------------------------------------------
void
VVTK_Renderer1
VVTK_Renderer1
::OnAdjustActors()
{
- if(SVTK_Renderer::OnAdjustActors()){
- myImplicitFunctionWidget->PlaceWidget(myBndBox);
- myImplicitFunctionWidget->SetOrigin((myBndBox[1] + myBndBox[0]) / 2.0,
- (myBndBox[3] + myBndBox[2]) / 2.0,
- (myBndBox[5] + myBndBox[4]) / 2.0);
- myImplicitFunctionWidget->SetHandleSize(myImplicitFunctionWidget->GetHandleSize());
- return true;
- }
- return false;
+ return SVTK_Renderer::OnAdjustActors();
}
switch(theEvent){
case vtkCommand::EndInteractionEvent:
- self->OnEndInteractionEvent();
+ self->OnEndInteractionEvent();
break;
}
}
bool
OnAdjustActors();
+ void AdjustImplicitFunctionWidget();
+
vtkSmartPointer<VISU_ImplicitFunctionWidget> myImplicitFunctionWidget;
VISU_OutsideCursorSettings* myOutsideCursorSettings;
vtkSmartPointer<VISU_FPSActor> myTextActor;