-attribute float results;
+attribute int mode;
attribute float clamp;
attribute float geomSize;
attribute float minSize;
gl_FrontColor = gl_Color;
float size;
- if( results == 1 )
- size = minSize + ( maxSize - minSize ) * ( 1 - gl_Color.w / 241.0f );
+ if( mode == 0 )
+ size = minSize + ( maxSize - minSize ) * ( 1 - gl_Color.w / 241.0f );
else
size = geomSize;
myScalarBarCtrl(VISU_ScalarBarCtrl::New()),
myBarVisibility(true),
myPickingSettings(NULL),
+ myInsideCursorSettings(NULL),
myCurrentPL(NULL)
{
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::VISU_GaussPtsAct - this = "<<this);
Superclass::ShallowCopyPL(thePipeLine);
VISU_GaussPointsPL* aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
- myDeviceActor->ShallowCopyPL(aPipeLine);
+ //myDeviceActor->ShallowCopyPL(aPipeLine);
+ //myDeviceActor->GetPipeLine()->SetMagnification( aPipeLine->GetMagnification() );
}
void* vtkNotUsed(theCallData))
{
if(vtkObject* anObject = reinterpret_cast<vtkObject*>(theClientData))
- if(VISU_GaussPtsAct* self = dynamic_cast<VISU_GaussPtsAct*>(anObject))
- self->OnInteractorEvent(theEvent);
+ if(VISU_GaussPtsAct* self = dynamic_cast<VISU_GaussPtsAct*>(anObject)) {
+ if(theEvent == VISU::UpdateInsideSettingsEvent)
+ self->UpdateInsideCursorSettings();
+ else
+ self->OnInteractorEvent(theEvent);
+ }
}
//-------------------------------------------------------------------------
Update();
}
+//----------------------------------------------------------------
+void
+VISU_GaussPtsAct
+::SetInsideCursorSettings(VISU_InsideCursorSettings* theInsideCursorSettings)
+{
+ if(myInsideCursorSettings == theInsideCursorSettings)
+ return;
+
+ if(myInsideCursorSettings)
+ myInsideCursorSettings->RemoveObserver(myEventCallbackCommand.GetPointer());
+
+ myInsideCursorSettings = theInsideCursorSettings;
+
+ if(theInsideCursorSettings)
+ theInsideCursorSettings->AddObserver(VISU::UpdateInsideSettingsEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
+}
+
+void
+VISU_GaussPtsAct
+::UpdateInsideCursorSettings()
+{
+ UpdateInsideCursorSettings( myDeviceActor );
+}
+
+void
+VISU_GaussPtsAct
+::UpdateInsideCursorSettings( PDeviceActor theActor )
+{
+ VISU_GaussPointsPL* aPipeline = theActor->GetPipeLine();
+
+ aPipeline->SetPrimitiveType( myInsideCursorSettings->GetPrimitiveType() );
+ aPipeline->SetClamp( myInsideCursorSettings->GetClamp() );
+ aPipeline->SetImageData( myInsideCursorSettings->GetTexture() );
+ aPipeline->SetAlphaThreshold( myInsideCursorSettings->GetAlphaThreshold() );
+ aPipeline->SetMinSize( myInsideCursorSettings->GetMinSize() );
+ aPipeline->SetMaxSize( myInsideCursorSettings->GetMaxSize() );
+ aPipeline->SetMagnification( myInsideCursorSettings->GetMagnification() );
+ aPipeline->SetMagnificationIncrement( myInsideCursorSettings->GetIncrement() );
+
+ Update();
+}
+
//==============================================================================
vtkStandardNewMacro(VISU_GaussPtsAct1);
VISU_GaussPointsPL* aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
- myInsideDeviceActor->ShallowCopyPL(aPipeLine);
+ //myInsideDeviceActor->ShallowCopyPL(aPipeLine);
+ //myInsideDeviceActor->GetPipeLine()->SetMagnification( aPipeLine->GetMagnification() );
+
+ myDeviceActor->ShallowCopyPL(aPipeLine);
// Restore implicit function
if(myWidget){
mySetVisibilitySignal(GetVisibility());
}
+//----------------------------------------------------------------
+void
+VISU_GaussPtsAct1
+::UpdateInsideCursorSettings()
+{
+ Superclass::UpdateInsideCursorSettings( myInsideDeviceActor );
+}
+
//----------------------------------------------------------------
void
VISU_GaussPtsAct1
{
VISU_GaussPointsPL* aPipeline = myOutsideDeviceActor->GetPipeLine();
+ aPipeline->SetPrimitiveType( myOutsideCursorSettings->GetPrimitiveType() );
aPipeline->SetClamp( myOutsideCursorSettings->GetClamp() );
aPipeline->SetImageData( myOutsideCursorSettings->GetTexture() );
aPipeline->SetAlphaThreshold( myOutsideCursorSettings->GetAlphaThreshold() );
aPipeline->SetSize( myOutsideCursorSettings->GetSize() );
- myOutsideDeviceActor->GetPSMapper()->SetPointSpriteResults(false);
- myOutsideDeviceActor->GetProperty()->SetColor(myOutsideCursorSettings->GetColor());
+ if( myOutsideCursorSettings->GetUniform() )
+ {
+ myOutsideDeviceActor->GetPSMapper()->SetPointSpriteMode( 1 ); // Geometry mode
+ myOutsideDeviceActor->GetProperty()->SetColor( myOutsideCursorSettings->GetColor() );
+ }
+ else
+ {
+ myOutsideDeviceActor->GetPSMapper()->SetPointSpriteMode( 2 ); // Outside cursor mode
+ myOutsideDeviceActor->GetPSMapper()->SetColorModeToMapScalars();
+ myOutsideDeviceActor->GetPSMapper()->ScalarVisibilityOn();
+ }
Update();
}
class VISU_ScalarBarCtrl;
class VISU_PickingSettings;
+class VISU_InsideCursorSettings;
class VISU_OutsideCursorSettings;
SVTK_SelectionEvent* theSelectionEvent,
bool theIsHighlight);
+ //----------------------------------------------------------------------------
+ void
+ SetInsideCursorSettings(VISU_InsideCursorSettings* theInsideCursorSettings);
+
+ virtual void
+ UpdateInsideCursorSettings();
+
+ virtual void
+ UpdateInsideCursorSettings( PDeviceActor );
+
//----------------------------------------------------------------------------
void
SetPickingSettings(VISU_PickingSettings* thePickingSettings);
bool myBarVisibility;
vtkSmartPointer<VISU_ScalarBarCtrl> myScalarBarCtrl;
+ VISU_InsideCursorSettings* myInsideCursorSettings;
VISU_PickingSettings* myPickingSettings;
};
void
Connect(VISU_GaussPtsAct2* theActor);
+ //----------------------------------------------------------------------------
+ virtual void
+ UpdateInsideCursorSettings();
+
//----------------------------------------------------------------------------
void
SetOutsideCursorSettings(VISU_OutsideCursorSettings* theOutsideCursorSettings);
#include <vtkImageData.h>
//----------------------------------------------------------------
+vtkStandardNewMacro( VISU_InsideCursorSettings );
vtkStandardNewMacro( VISU_OutsideCursorSettings );
vtkStandardNewMacro( VISU_PickingSettings );
+//----------------------------------------------------------------
+VISU_InsideCursorSettings::VISU_InsideCursorSettings()
+{
+ this->Initial = true;
+
+ this->PrimitiveType = -1;
+ this->Clamp = -1;
+ this->Texture = NULL;
+ this->AlphaThreshold = -1;
+ this->MinSize = -1;
+ this->MaxSize = -1;
+ this->Magnification = -1;
+ this->Increment = -1;
+}
+
+VISU_InsideCursorSettings::~VISU_InsideCursorSettings()
+{
+ this->SetTexture( NULL );
+}
+
//----------------------------------------------------------------
VISU_OutsideCursorSettings::VISU_OutsideCursorSettings()
{
this->Initial = true;
+ this->PrimitiveType = -1;
this->Clamp = -1;
this->Texture = NULL;
this->AlphaThreshold = -1;
this->Size = -1;
+ this->Uniform = false;
this->Color[0] = -1;
this->Color[1] = -1;
this->Color[1] = -1;
//============================================================================
namespace VISU
{
- const vtkIdType UpdateOutsideSettingsEvent = vtkCommand::UserEvent + 100;
- const vtkIdType UpdatePickingSettingsEvent = vtkCommand::UserEvent + 200;
+ const vtkIdType UpdateInsideSettingsEvent = vtkCommand::UserEvent + 100;
+ const vtkIdType UpdateOutsideSettingsEvent = vtkCommand::UserEvent + 200;
+ const vtkIdType UpdatePickingSettingsEvent = vtkCommand::UserEvent + 300;
}
+
+//============================================================================
+class VISU_InsideCursorSettings : public vtkObject
+{
+ public:
+ vtkTypeMacro( VISU_InsideCursorSettings, vtkObject );
+
+ VISU_InsideCursorSettings();
+ virtual ~VISU_InsideCursorSettings();
+
+ static
+ VISU_InsideCursorSettings*
+ New();
+
+ vtkSetMacro( Initial, bool );
+ vtkGetMacro( Initial, bool );
+
+ vtkSetMacro( PrimitiveType, int );
+ vtkGetMacro( PrimitiveType, int );
+
+ vtkSetMacro( Clamp, float );
+ vtkGetMacro( Clamp, float );
+
+ vtkSetMacro( Texture, vtkImageData* );
+ vtkGetMacro( Texture, vtkImageData* );
+
+ vtkSetMacro( AlphaThreshold, float );
+ vtkGetMacro( AlphaThreshold, float );
+
+ vtkSetMacro( MinSize, float );
+ vtkGetMacro( MinSize, float );
+
+ vtkSetMacro( MaxSize, float );
+ vtkGetMacro( MaxSize, float );
+
+ vtkSetMacro( Magnification, float );
+ vtkGetMacro( Magnification, float );
+
+ vtkSetMacro( Increment, float );
+ vtkGetMacro( Increment, float );
+
+
+private:
+ bool Initial;
+
+ int PrimitiveType;
+ float Clamp;
+ vtkImageData* Texture;
+ float AlphaThreshold;
+ float MinSize;
+ float MaxSize;
+ float Magnification;
+ float Increment;
+};
+
+
+//============================================================================
class VISU_OutsideCursorSettings : public vtkObject
{
public:
vtkSetMacro( Initial, bool );
vtkGetMacro( Initial, bool );
+ vtkSetMacro( PrimitiveType, int );
+ vtkGetMacro( PrimitiveType, int );
+
vtkSetMacro( Clamp, float );
vtkGetMacro( Clamp, float );
vtkSetMacro( Size, float );
vtkGetMacro( Size, float );
+ vtkSetMacro( Uniform, bool );
+ vtkGetMacro( Uniform, bool );
+
vtkSetVector3Macro( Color, float );
vtkGetVector3Macro( Color, float );
private:
bool Initial;
+ int PrimitiveType;
float Clamp;
vtkImageData* Texture;
float AlphaThreshold;
float Size;
+ bool Uniform;
float Color[3];
};
//----------------------------------------------------------------------------
VISU_GaussPointsPL
::VISU_GaussPointsPL():
+ myPrimitiveType(0),
myClamp(200.0),
mySize(10),
myMinSize(3),
myPSMapper->SetInput(aDatsSet);
SetGaussPtsIDMapper(aPipeLine->GetGaussPtsIDMapper());
+ SetPrimitiveType(aPipeLine->GetPrimitiveType());
SetClamp(aPipeLine->GetClamp());
SetSize(aPipeLine->GetSize());
SetMinSize(aPipeLine->GetMinSize());
VISU_GaussPointsPL
::SetIsColored(bool theIsColored)
{
- myPSMapper->SetPointSpriteResults( theIsColored );
+ myPSMapper->SetPointSpriteMode( theIsColored ? 0 : 1 ); // Results / Geometry
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_GaussPointsPL
+::SetPrimitiveType(int thePrimitiveType)
+{
+ myPrimitiveType = thePrimitiveType;
+ myPSMapper->SetPointSpritePrimitiveType( thePrimitiveType );
+
+ Modified();
}
//----------------------------------------------------------------------------
void SetIsColored(bool theIsColored);
+ void
+ SetPrimitiveType(int thePrimitiveType);
+
+ int
+ GetPrimitiveType() { return myPrimitiveType; }
+
float
GetMaximumSupportedSize();
float myDeltaScalarRange;
float myAverageCellSize;
+ int myPrimitiveType;
float myClamp;
float mySize;
float myMinSize;
#include <vtkTimerLog.h>
#include <vtkTriangle.h>
-#include <GL/glext.h>
+//#include <GL/glext.h>
//#include <GL/glx.h>
#include <dlfcn.h>
this->UseTextures = true;
this->UseShader = true;
- this->PointSpriteResults = true;
+ this->PointSpriteMode = 0;
+
+ this->PointSpritePrimitiveType = 0;
this->PointSpriteClamp = 100.0;
this->PointSpriteSize = 0.0;
VISU_OpenGLPointSpriteMapper* m = VISU_OpenGLPointSpriteMapper::SafeDownCast(mapper);
if( m != NULL )
{
- this->SetPointSpriteResults( m->GetPointSpriteResults() );
+ this->SetPointSpriteMode( m->GetPointSpriteMode() );
+ this->SetPointSpritePrimitiveType( m->GetPointSpritePrimitiveType() );
this->SetPointSpriteClamp( m->GetPointSpriteClamp() );
this->SetPointSpriteSize( m->GetPointSpriteSize() );
this->SetPointSpriteMinSize( m->GetPointSpriteMinSize() );
}
#endif
//-----------------------------------------------------------------------------
-void VISU_OpenGLPointSpriteMapper::SetPointSpriteResults( bool theResults )
+void VISU_OpenGLPointSpriteMapper::SetPointSpriteMode( int theMode )
{
- float aResults = theResults ? 1.0 : 0.0;
-
- //cout << "SetPointSpriteResults " << this << " " << aResults << endl;
+ //cout << "SetPointSpriteMode " << this << " " << aMode << endl;
- this->PointSpriteResults = theResults;
+ this->PointSpriteMode = theMode;
//#ifdef GL_ARB_shader_objects
- //this->SetShaderVariable( "results", theMagnification );
+ //this->SetShaderVariable( "mode", theMode );
//#endif
this->Modified();
}
//-----------------------------------------------------------------------------
+void VISU_OpenGLPointSpriteMapper::SetPointSpritePrimitiveType( int thePrimitiveType )
+{
+ this->PointSpritePrimitiveType = thePrimitiveType;
+ this->Modified();
+}
+//-----------------------------------------------------------------------------
void VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp( float theClamp )
{
this->PointSpriteClamp = theClamp;
// (PFNGLUSEPROGRAMOBJECTARBPROC)dlsym( this->OpenGLLibrary, "glUseProgramObjectARB" );
//glUseProgramObjectARB( VISU_OpenGLPointSpriteMapper::VertexProgram );
/*
- this->SetShaderVariable( "results", this->PointSpriteResults );
+ this->SetShaderVariable( "mode", this->PointSpriteMode );
this->SetShaderVariable( "clamp", this->PointSpriteClamp );
this->SetShaderVariable( "geomSize", this->PointSpriteSize );
this->SetShaderVariable( "minSize", this->PointSpriteMinSize );
this->MapScalars(this->ActorOpacity);
// Initializing the texture for Point Sprites
- if( this->UseTextures )
+ if( this->UseTextures && this->PointSpritePrimitiveType == 0 )
this->InitTextures();
//
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
- //cout << this << " THRESHOLD " << this->PointSpriteAlphaThreshold << endl;
glEnable( GL_ALPHA_TEST );
glAlphaFunc( GL_GREATER, this->PointSpriteAlphaThreshold );
break;
glDepthFunc( GL_LEQUAL );
glEnable( GL_DEPTH_TEST );
+ glEnable( GL_ALPHA_TEST );
+ glAlphaFunc( GL_GREATER, this->PointSpriteAlphaThreshold );
+
glDisable( GL_BLEND );
break;
}
glUseProgramObjectARB( myVertexProgram );
- this->SetShaderVariable( "results", this->PointSpriteResults );
+ this->SetShaderVariable( "mode", this->PointSpriteMode );
this->SetShaderVariable( "clamp", this->PointSpriteClamp );
this->SetShaderVariable( "geomSize", this->PointSpriteSize );
this->SetShaderVariable( "minSize", this->PointSpriteMinSize );
aVertex[i].vz = p->GetPoint( pts[0] )[2];
float red, green, blue;
- if( colors && this->PointSpriteResults )
+ if( colors && this->PointSpriteMode != 1 )
{
unsigned char *col = colors->GetPointer(pts[0]<< 2);
red = ( ( int )col[0] ) / 255.0;
// Draw method for OpenGL.
int VISU_OpenGLPointSpriteMapper::Draw(vtkRenderer *aren, vtkActor *act)
{
+ //cout << "VISU_OpenGLPointSpriteMapper::Draw" << endl;
+
if( this->UseOpenGLMapper )
return MAPPER_SUPERCLASS::Draw( aren, act );
// Description:
// Point Sprite drawing mode
- // (Results - multicolor, Geometry - fixed color)
- vtkGetMacro(PointSpriteResults, bool);
- void SetPointSpriteResults( bool );
+ // 0 - Results - different colors, different sizes
+ // 1 - Geometry - fixed color, fixed size
+ // 2 - Outside - different colors, fixed size
+ vtkGetMacro(PointSpriteMode, int);
+ void SetPointSpriteMode( int );
+
+ // Description:
+ // Point Sprite primitive type
+ vtkGetMacro(PointSpritePrimitiveType, int);
+ void SetPointSpritePrimitiveType( int );
// Description:
// Point Sprite size parameters
GLhandleARB myVertexProgram;
#endif
- bool PointSpriteResults;
+ int PointSpriteMode;
+ int PointSpritePrimitiveType;
float PointSpriteClamp;
float PointSpriteSize;
float PointSpriteMinSize;
msgid "ICON_VVTK_PLANE_SEGMENTATION_SWITCH"
msgstr "Visu_PlaneSegmentation.png"
+msgid "ICON_VVTK_SPHERE_SEGMENTATION_SWITCH"
+msgstr "Visu_SphereSegmentation.png"
+
+msgid "ICON_VVTK_RECORDING_START"
+msgstr "Visu_recording_start.png"
+
+msgid "ICON_VVTK_RECORDING_PLAY"
+msgstr "Visu_recording_play.png"
+
+msgid "ICON_VVTK_RECORDING_PAUSE"
+msgstr "Visu_recording_pause.png"
+
+msgid "ICON_VVTK_RECORDING_STOP"
+msgstr "Visu_recording_stop.png"
+
msgid "ICON_LOAD_TEXTURE"
msgstr "Visu_load_texture.png"
msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL"
msgstr "Primitive"
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_TYPE"
+msgstr "Primitive Type"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_POINTSPRITE"
+msgstr "Point sprite"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_OPENGLPOINT"
+msgstr "OpenGL point"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOMSPHERE"
+msgstr "Geometrical sphere"
+
msgid "VisuGUI_Module::VISU_GAUSS_PREF_CLAMP"
msgstr "Maximum Size (Clamp)"
msgid "VisuGUI_Module::VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL"
msgstr "Outside Cursor Gauss Points"
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_UNIFORM_COLOR"
+msgstr "Uniform Color"
+
+msgid "VisuGUI_Module::VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL"
+msgstr "Inside Cursor Gauss Points"
+
msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR_GROUP_TTL"
msgstr "Color"
msgid "VVTK_ViewManager::VTK_VIEW_TITLE"
msgstr "VISU scene:%1 - viewer:%2"
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_START"
+msgstr "Start recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_START"
+msgstr "Start recording"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PLAY"
+msgstr "Play recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PLAY"
+msgstr "Play recording"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PAUSE"
+msgstr "Pause recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PAUSE"
+msgstr "Pause recording"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_STOP"
+msgstr "Stop recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_STOP"
+msgstr "Stop recording"
+
msgid "VVTK_MainWindow1::MNU_VVTK_INTERACTOR_STYLE_SWITCH"
msgstr "Interaction Style Switch"
msgid "VVTK_MainWindow1::DSC_VVTK_PLANE_SEGMENTATION_SWITCH"
msgstr "Plane Segmentation Switch"
-msgid "VisuGUI_GaussPointsDlg::&Cancel"
-msgstr ""
+msgid "VVTK_MainWindow1::MNU_VVTK_SPHERE_SEGMENTATION_SWITCH"
+msgstr "Sphere Segmentation Switch"
-msgid "VisuGUI_GaussPointsDlg::&OK"
-msgstr ""
+msgid "VVTK_MainWindow1::DSC_VVTK_SPHERE_SEGMENTATION_SWITCH"
+msgstr "Sphere Segmentation Switch"
-msgid "VisuGUI_GaussPointsDlg::DLG_TITLE"
-msgstr "Gauss Points"
-
-msgid "VisuGUI_GaussPointsDlg::GAUSS_POINTS_TAB"
-msgstr "Gauss Points"
-
-msgid "VisuGUI_GaussPointsDlg::SCALAR_BAR_TAB"
-msgstr "Scalar Bar"
-
-msgid "VisuGUI_GaussPointsDlg::PRS_TITLE"
-msgstr "Presentation"
-
-msgid "VisuGUI_GaussPointsDlg::RESULTS"
-msgstr "Results"
-
-msgid "VisuGUI_GaussPointsDlg::GEOMETRY"
-msgstr "Geometry"
-
-msgid "VisuGUI_GaussPointsDlg::PRIMITIVE_TITLE"
+msgid "VVTK_PrimitiveBox::PRIMITIVE_TITLE"
msgstr "Primitive"
-msgid "VisuGUI_GaussPointsDlg::POINT_SPRITE"
+msgid "VVTK_PrimitiveBox::POINT_SPRITE"
msgstr "Point Sprite"
-msgid "VisuGUI_GaussPointsDlg::OPENGL_POINT"
+msgid "VVTK_PrimitiveBox::OPENGL_POINT"
msgstr "OpenGL Point"
-msgid "VisuGUI_GaussPointsDlg::GEOMETRICAL_SPHERE"
+msgid "VVTK_PrimitiveBox::GEOMETRICAL_SPHERE"
msgstr "Geometrical Sphere"
-msgid "VisuGUI_GaussPointsDlg::MAXIMUM_SIZE"
+msgid "VVTK_PrimitiveBox::CLAMP"
msgstr "Maximum Size (Clamp) : "
-msgid "VisuGUI_GaussPointsDlg::MAIN_TEXTURE"
+msgid "VVTK_PrimitiveBox::MAIN_TEXTURE"
msgstr "Main Texture (16x16) : "
-msgid "VisuGUI_GaussPointsDlg::ALPHA_TEXTURE"
+msgid "VVTK_PrimitiveBox::ALPHA_TEXTURE"
msgstr "Alpha Channel Texture (16x16) : "
-msgid "VisuGUI_GaussPointsDlg::ALPHA_THRESHOLD"
+msgid "VVTK_PrimitiveBox::ALPHA_THRESHOLD"
msgstr "Alpha Channel Threshold : "
-msgid "VisuGUI_GaussPointsDlg::SIZE_TITLE"
+msgid "VVTK_SizeBox::SIZE_TITLE"
msgstr "Size"
-msgid "VisuGUI_GaussPointsDlg::SIZE"
+msgid "VVTK_SizeBox::OUTSIDE_SIZE"
+msgstr "Percentage of normal size(%) : "
+
+msgid "VVTK_SizeBox::GEOM_SIZE"
msgstr "Size of points (%) : "
-msgid "VisuGUI_GaussPointsDlg::MIN_SIZE"
+msgid "VVTK_SizeBox::MIN_SIZE"
msgstr "Range values for min size (%) : "
-msgid "VisuGUI_GaussPointsDlg::MAX_SIZE"
+msgid "VVTK_SizeBox::MAX_SIZE"
msgstr "max size (%) : "
-msgid "VisuGUI_GaussPointsDlg::MAGNIFICATION"
+msgid "VVTK_SizeBox::MAGNIFICATION"
msgstr "Magnification (%) : "
-msgid "VisuGUI_GaussPointsDlg::INCREMENT"
+msgid "VVTK_SizeBox::INCREMENT"
msgstr "+/- Ratio : "
-msgid "VisuGUI_GaussPointsDlg::COLOR_TITLE"
+msgid "VVTK_SizeBox::COLOR_TITLE"
msgstr "Color"
-msgid "VisuGUI_GaussPointsDlg::COLOR"
+msgid "VVTK_SizeBox::UNIFORM_COLOR"
+msgstr "Uniform Color"
+
+msgid "VVTK_SizeBox::COLOR"
msgstr "Color : "
+msgid "VisuGUI_GaussPointsDlg::&Cancel"
+msgstr ""
+
+msgid "VisuGUI_GaussPointsDlg::&OK"
+msgstr ""
+
+msgid "VisuGUI_GaussPointsDlg::DLG_TITLE"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_GaussPointsDlg::GAUSS_POINTS_TAB"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_GaussPointsDlg::SCALAR_BAR_TAB"
+msgstr "Scalar Bar"
+
+msgid "VisuGUI_GaussPointsDlg::PRS_TITLE"
+msgstr "Presentation"
+
+msgid "VisuGUI_GaussPointsDlg::RESULTS"
+msgstr "Results"
+
+msgid "VisuGUI_GaussPointsDlg::GEOMETRY"
+msgstr "Geometry"
+
msgid "VisuGUI_GaussScalarBarPane::ACTIVE_BAR_GRP"
msgstr "Active bar"
msgid "VVTK_SegmentationCursorDlg::DEPTH"
msgstr "Depth of the cursor: "
-msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_TAB"
-msgstr "Segmentation Cursor"
+msgid "VVTK_SegmentationCursorDlg::RADIUS_TITLE"
+msgstr "Radius"
-msgid "VVTK_SegmentationCursorDlg::PRIMITIVE_TITLE"
-msgstr "Primitive"
+msgid "VVTK_SegmentationCursorDlg::RADIUS"
+msgstr "Radius of the cursor :"
-msgid "VVTK_SegmentationCursorDlg::POINT_SPRITE"
-msgstr "Point Sprite"
-
-msgid "VVTK_SegmentationCursorDlg::OPENGL_POINT"
-msgstr "OpenGL Point"
-
-msgid "VVTK_SegmentationCursorDlg::GEOMETRICAL_SPHERE"
-msgstr "Geometrical Sphere"
-
-msgid "VVTK_SegmentationCursorDlg::MAXIMUM_SIZE"
-msgstr "Maximum Size (Clamp) : "
-
-msgid "VVTK_SegmentationCursorDlg::MAIN_TEXTURE"
-msgstr "Main Texture (16x16) : "
-
-msgid "VVTK_SegmentationCursorDlg::ALPHA_TEXTURE"
-msgstr "Alpha Channel Texture (16x16) : "
+msgid "VVTK_SegmentationCursorDlg::RATIO"
+msgstr "+/- Ratio :"
-msgid "VVTK_SegmentationCursorDlg::ALPHA_THRESHOLD"
-msgstr "Alpha Channel Threshold : "
-
-msgid "VVTK_SegmentationCursorDlg::SIZE_TITLE"
-msgstr "Size"
-
-msgid "VVTK_SegmentationCursorDlg::SIZE"
-msgstr "Percentage of normal size (%) : "
+msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_TAB"
+msgstr "Segmentation Cursor"
-msgid "VVTK_SegmentationCursorDlg::COLOR_TITLE"
-msgstr "Color"
+msgid "VVTK_SegmentationCursorDlg::GAUSS_POINTS_TAB"
+msgstr "Gauss Points"
-msgid "VVTK_SegmentationCursorDlg::COLOR"
-msgstr "Color : "
+msgid "VVTK_SegmentationCursorDlg::INSIDE_GAUSS_POINTS"
+msgstr "Inside Cursor Gauss Points Presentation"
-msgid "VVTK_SegmentationCursorDlg::OUTSIDE_CURSOR_TAB"
-msgstr "Outside Cursor Gauss Points"
+msgid "VVTK_SegmentationCursorDlg::OUTSIDE_GAUSS_POINTS"
+msgstr "Outside Cursor Gauss Points Presentation"
msgid "VVTK_PickingDlg::PICKING_DLG_TITLE"
msgstr "Picking"
#include "VISU_GaussPointsPL.hxx"
#include "VISU_Convertor.hxx"
+#include "VVTK_PrimitiveBox.h"
+#include "VVTK_SizeBox.h"
+
#include "SalomeApp_Application.h"
#include "SalomeApp_Module.h"
#include "SUIT_Desktop.h"
aBox->setSpacing(6);
// Primitive
- QGroupBox* PrimitiveGroup = new QGroupBox ( tr( "PRIMITIVE_TITLE" ), aBox, "PrimitiveGroup" );
- PrimitiveGroup->setColumnLayout(0, Qt::Vertical );
- PrimitiveGroup->layout()->setSpacing( 0 );
- PrimitiveGroup->layout()->setMargin( 0 );
-
- QGridLayout* PrimitiveGroupLayout = new QGridLayout (PrimitiveGroup->layout());
- PrimitiveGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- PrimitiveGroupLayout->setSpacing(6);
- PrimitiveGroupLayout->setMargin(11);
-
- // Primitive Type
- QButtonGroup* aPrimitiveTypeGroup = new QButtonGroup( 3, Qt::Horizontal, PrimitiveGroup, "PrimitiveTypeGroup" );
- aPrimitiveTypeGroup->setRadioButtonExclusive( true );
- aPrimitiveTypeGroup->setFrameStyle( QFrame::NoFrame );
- aPrimitiveTypeGroup->layout()->setMargin( 0 );
-
- QRadioButton* aPointSpriteButton = new QRadioButton( tr( "POINT_SPRITE" ), aPrimitiveTypeGroup );
- aPointSpriteButton->setChecked( true );
-
- QRadioButton* anOpenGLPointButton = new QRadioButton( tr( "OPENGL_POINT" ), aPrimitiveTypeGroup );
- anOpenGLPointButton->setEnabled( false );
-
- QRadioButton* aGeometricalSphereButton = new QRadioButton( tr( "GEOMETRICAL_SPHERE" ), aPrimitiveTypeGroup );
- aGeometricalSphereButton->setEnabled( false );
-
- PrimitiveGroupLayout->addMultiCellWidget( aPrimitiveTypeGroup, 0, 0, 0, 2 );
-
- // Clamp
- QLabel* aClampLabel = new QLabel( tr( "MAXIMUM_SIZE" ), PrimitiveGroup );
- myClampSpinBox = new QtxDblSpinBox( 1.0, 512.0, 1.0, PrimitiveGroup );
- myClampSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- PrimitiveGroupLayout->addWidget( aClampLabel, 1, 0 );
- PrimitiveGroupLayout->addMultiCellWidget( myClampSpinBox, 1, 1, 1, 2 );
-
- // Main Texture
- QLabel* aMainTextureLabel = new QLabel( tr( "MAIN_TEXTURE" ), PrimitiveGroup );
- myMainTextureLineEdit = new QLineEdit( PrimitiveGroup );
- QPushButton* aMainTextureButton = new QPushButton( PrimitiveGroup );
- aMainTextureButton->setAutoDefault( false );
- aMainTextureButton->setPixmap( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
- connect( aMainTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseMainTexture() ) );
-
- PrimitiveGroupLayout->addWidget( aMainTextureLabel, 2, 0 );
- PrimitiveGroupLayout->addWidget( myMainTextureLineEdit, 2, 1 );
- PrimitiveGroupLayout->addWidget( aMainTextureButton, 2, 2 );
-
- // Alpha Texture
- QLabel* aAlphaTextureLabel = new QLabel( tr( "ALPHA_TEXTURE" ), PrimitiveGroup );
- myAlphaTextureLineEdit = new QLineEdit( PrimitiveGroup );
- QPushButton* aAlphaTextureButton = new QPushButton( PrimitiveGroup );
- aAlphaTextureButton->setAutoDefault( false );
- aAlphaTextureButton->setPixmap( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
- connect( aAlphaTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseAlphaTexture() ) );
-
- PrimitiveGroupLayout->addWidget( aAlphaTextureLabel, 3, 0 );
- PrimitiveGroupLayout->addWidget( myAlphaTextureLineEdit, 3, 1 );
- PrimitiveGroupLayout->addWidget( aAlphaTextureButton, 3, 2 );
-
- // Alpha Threshold
- QLabel* aAlphaThresholdLabel = new QLabel( tr( "ALPHA_THRESHOLD" ), PrimitiveGroup );
- myAlphaThresholdSpinBox = new QtxDblSpinBox( 0.0, 1.0, 0.1, PrimitiveGroup );
- myAlphaThresholdSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- PrimitiveGroupLayout->addWidget( aAlphaThresholdLabel, 4, 0 );
- PrimitiveGroupLayout->addMultiCellWidget( myAlphaThresholdSpinBox, 4, 4, 1, 2 );
+ myPrimitiveBox = new VVTK_PrimitiveBox( aBox );
// Size
- QGroupBox* SizeGroup = new QGroupBox ( tr( "SIZE_TITLE" ), aBox, "SizeGroup" );
- SizeGroup->setColumnLayout(0, Qt::Vertical );
- SizeGroup->layout()->setSpacing( 0 );
- SizeGroup->layout()->setMargin( 0 );
-
- QGridLayout* SizeGroupLayout = new QGridLayout (SizeGroup->layout());
- SizeGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- SizeGroupLayout->setSpacing(6);
- SizeGroupLayout->setMargin(11);
-
- // Geometry Size
- mySizeLabel = new QLabel( tr( "SIZE" ), SizeGroup );
- mySizeSpinBox = new QtxDblSpinBox( 0, 100, 1, SizeGroup );
- mySizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- SizeGroupLayout->addWidget( mySizeLabel, 0, 0 );
- SizeGroupLayout->addWidget( mySizeSpinBox, 0, 1 );
-
- // Min Size
- myMinSizeLabel = new QLabel( tr( "MIN_SIZE" ), SizeGroup );
- myMinSizeSpinBox = new QtxDblSpinBox( 0, 100, 1, SizeGroup );
- myMinSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- SizeGroupLayout->addWidget( myMinSizeLabel, 1, 0 );
- SizeGroupLayout->addWidget( myMinSizeSpinBox, 1, 1 );
-
- // Max Size
- myMaxSizeLabel = new QLabel( tr( "MAX_SIZE" ), SizeGroup );
- myMaxSizeSpinBox = new QtxDblSpinBox( 0, 100, 1, SizeGroup );
- myMaxSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- SizeGroupLayout->addWidget( myMaxSizeLabel, 1, 2 );
- SizeGroupLayout->addWidget( myMaxSizeSpinBox, 1, 3 );
-
- // Magnification
- QLabel* aMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), SizeGroup );
- myMagnificationSpinBox = new QtxDblSpinBox( 10, 1000, 10, SizeGroup );
- myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- SizeGroupLayout->addWidget( aMagnificationLabel, 2, 0 );
- SizeGroupLayout->addWidget( myMagnificationSpinBox, 2, 1 );
-
- // Increment
- QLabel* aIncrementLabel = new QLabel( tr( "INCREMENT" ), SizeGroup );
- myIncrementSpinBox = new QtxDblSpinBox( 0.01, 10, 0.1, SizeGroup );
- myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ mySizeBox = new VVTK_SizeBox( aBox );
- SizeGroupLayout->addWidget( aIncrementLabel, 2, 2 );
- SizeGroupLayout->addWidget( myIncrementSpinBox, 2, 3 );
-
-
- // Color
- myColorGroup = new QGroupBox ( tr( "COLOR_TITLE" ), aBox, "ColorGroup" );
- myColorGroup->setColumnLayout(0, Qt::Vertical );
- myColorGroup->layout()->setSpacing( 0 );
- myColorGroup->layout()->setMargin( 0 );
-
- QGridLayout* ColorGroupLayout = new QGridLayout (myColorGroup->layout());
- ColorGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
- ColorGroupLayout->setSpacing(6);
- ColorGroupLayout->setMargin(11);
-
- QLabel* ColorLabel = new QLabel( tr( "COLOR" ), myColorGroup );
- myColorButton = new QPushButton( myColorGroup );
-
- ColorGroupLayout->addWidget( ColorLabel, 0, 0 );
- ColorGroupLayout->addWidget( myColorButton, 0, 1 );
-
- connect( myColorButton, SIGNAL( clicked() ), this, SLOT( onColorButtonPressed() ) );
-
- connect( myGeometryButton, SIGNAL( toggled( bool ) ), myColorGroup, SLOT( setEnabled( bool ) ) );
- connect( myGeometryButton, SIGNAL( toggled( bool ) ), mySizeLabel, SLOT( setEnabled( bool ) ) );
- connect( myGeometryButton, SIGNAL( toggled( bool ) ), mySizeSpinBox, SLOT( setEnabled( bool ) ) );
- connect( myResultsButton, SIGNAL( toggled( bool ) ), myMinSizeLabel, SLOT( setEnabled( bool ) ) );
- connect( myResultsButton, SIGNAL( toggled( bool ) ), myMinSizeSpinBox, SLOT( setEnabled( bool ) ) );
- connect( myResultsButton, SIGNAL( toggled( bool ) ), myMaxSizeLabel, SLOT( setEnabled( bool ) ) );
- connect( myResultsButton, SIGNAL( toggled( bool ) ), myMaxSizeSpinBox, SLOT( setEnabled( bool ) ) );
+ connect( myResultsButton, SIGNAL( clicked() ), mySizeBox, SLOT( onToggleResults() ) );
+ connect( myGeometryButton, SIGNAL( clicked() ), mySizeBox, SLOT( onToggleGeometry() ) );
myScalarPane = new VisuGUI_GaussScalarBarPane(this, SetPref);
myScalarPane->setMargin(5);
myResultsButton->setChecked( isResults );
myGeometryButton->setChecked( !isResults );
- myColorGroup->setEnabled( !isResults );
- mySizeLabel->setEnabled( !isResults );
- mySizeSpinBox->setEnabled( !isResults );
- myMinSizeLabel->setEnabled( isResults );
- myMinSizeSpinBox->setEnabled( isResults );
- myMaxSizeLabel->setEnabled( isResults );
- myMaxSizeSpinBox->setEnabled( isResults );
+ myPrimitiveBox->setPrimitiveType( thePrs->GetPrimitiveType() );
+ myPrimitiveBox->setClampMaximum( thePrs->GetMaximumSupportedSize() );
+ myPrimitiveBox->setClamp( thePrs->GetClamp() );
+ myPrimitiveBox->setMainTexture( thePrs->GetMainTexture() );
+ myPrimitiveBox->setAlphaTexture( thePrs->GetAlphaTexture() );
+ myPrimitiveBox->setAlphaThreshold( thePrs->GetAlphaThreshold() );
+
+ mySizeBox->setType( isResults ? VVTK_SizeBox::Results : VVTK_SizeBox::Geometry );
+ mySizeBox->setGeomSize( thePrs->GetGeomSize() );
+ mySizeBox->setMinSize( thePrs->GetMinSize() );
+ mySizeBox->setMaxSize( thePrs->GetMaxSize() );
+ mySizeBox->setMagnification( thePrs->GetMagnification() );
+ mySizeBox->setIncrement( thePrs->GetMagnificationIncrement() );
+ mySizeBox->setColor( thePrs->GetColor() );
- myColorButton->setPaletteBackgroundColor( thePrs->GetColor() );
+ myScalarPane->initFromPrsObject(thePrs);
+}
- myClampSpinBox->setMaxValue( thePrs->GetMaximumSupportedSize() );
- myClampSpinBox->setValue( thePrs->GetClamp() );
+int VisuGUI_GaussPointsDlg::storeToPrsObject( VISU::GaussPoints_i* thePrs )
+{
+ thePrs->SetPrimitiveType( myPrimitiveBox->getPrimitiveType() );
- mySizeSpinBox->setValue( thePrs->GetConstSize() );
- myMinSizeSpinBox->setValue( thePrs->GetMinSize() );
- myMaxSizeSpinBox->setValue( thePrs->GetMaxSize() );
+ thePrs->SetClamp( myPrimitiveBox->getClamp() );
- myMagnificationSpinBox->setValue( thePrs->GetMagnification() );
- myIncrementSpinBox->setValue( thePrs->GetMagnificationIncrement() );
+ QString aMainTexture = myPrimitiveBox->getMainTexture();
+ QString anAlphaTexture = myPrimitiveBox->getAlphaTexture();
- myMainTextureLineEdit->setText( thePrs->GetMainTexture().section( '/', -1 ) );
- myAlphaTextureLineEdit->setText( thePrs->GetAlphaTexture().section( '/', -1 ) );
- myAlphaThresholdSpinBox->setValue( thePrs->GetAlphaThreshold() );
+ aMainTexture = aMainTexture.isNull() ? thePrs->GetMainTexture() : aMainTexture;
+ anAlphaTexture = anAlphaTexture.isNull() ? thePrs->GetAlphaTexture() : anAlphaTexture;
+
+ thePrs->SetTextures( aMainTexture, anAlphaTexture );
- myScalarPane->initFromPrsObject(thePrs);
-}
+ thePrs->SetAlphaThreshold( myPrimitiveBox->getAlphaThreshold() );
-int VisuGUI_GaussPointsDlg::storeToPrsObject( VISU::GaussPoints_i* thePrs )
-{
- thePrs->SetClamp( myClampSpinBox->value() );
bool isResults = myResultsButton->isChecked();
if( isResults )
{
thePrs->SetIsColored( true );
- thePrs->SetMinSize( myMinSizeSpinBox->value() );
- thePrs->SetMaxSize( myMaxSizeSpinBox->value() );
+ thePrs->SetMinSize( mySizeBox->getMinSize() );
+ thePrs->SetMaxSize( mySizeBox->getMaxSize() );
}
else
{
thePrs->SetIsColored( false );
- thePrs->SetColor( myColorButton->paletteBackgroundColor() );
- thePrs->SetConstSize( mySizeSpinBox->value() );
+ thePrs->SetColor( mySizeBox->getColor() );
+ thePrs->SetGeomSize( mySizeBox->getGeomSize() );
}
- thePrs->SetMagnification( myMagnificationSpinBox->value() );
- thePrs->SetMagnificationIncrement( myIncrementSpinBox->value() );
-
- myMainTexture = myMainTexture.isNull() ? thePrs->GetMainTexture() : myMainTexture;
- myAlphaTexture = myAlphaTexture.isNull() ? thePrs->GetAlphaTexture() : myAlphaTexture;
- thePrs->SetTextures( myMainTexture, myAlphaTexture );
-
- thePrs->SetAlphaThreshold( myAlphaThresholdSpinBox->value() );
+ thePrs->SetMagnification( mySizeBox->getMagnification() );
+ thePrs->SetMagnificationIncrement( mySizeBox->getIncrement() );
return myScalarPane->storeToPrsObject(thePrs);
}
//if( myScalarPane->check() )
QDialog::accept();
}
-
-void VisuGUI_GaussPointsDlg::onBrowseMainTexture()
-{
- QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/";
- QString aFileName = QFileDialog::getOpenFileName( aRootDir, "Bitmap (*.bmp *.jpg *.png)", this );
-
- if( aFileName.isNull() )
- return;
-
- myMainTexture = aFileName;
- myMainTextureLineEdit->setText( aFileName.section( '/', -1 ) );
-}
-
-void VisuGUI_GaussPointsDlg::onBrowseAlphaTexture()
-{
- QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/";
- QString aFileName = QFileDialog::getOpenFileName( aRootDir, "Bitmap (*.bmp *.jpg *.png)", this );
-
- if( aFileName.isNull() )
- return;
-
- myAlphaTexture = aFileName;
- myAlphaTextureLineEdit->setText( aFileName.section( '/', -1 ) );
-}
-
-void VisuGUI_GaussPointsDlg::onColorButtonPressed()
-{
- QColor aColor = QColorDialog::getColor( myColorButton->paletteBackgroundColor(), this );
- if( aColor.isValid() )
- myColorButton->setPaletteBackgroundColor( aColor );
-}
#include <qtoolbutton.h>
class SalomeApp_Module;
+class VVTK_PrimitiveBox;
+class VVTK_SizeBox;
class VisuGUI_TextPrefDlg;
namespace VISU
void onTextPref();
};
+
class VisuGUI_GaussPointsDlg : public QDialog
{
- Q_OBJECT
-
+ Q_OBJECT
public:
- VisuGUI_GaussPointsDlg (SalomeApp_Module* theModule, bool SetPref = FALSE);
- ~VisuGUI_GaussPointsDlg() {};
+ VisuGUI_GaussPointsDlg (SalomeApp_Module* theModule, bool SetPref = FALSE);
+ ~VisuGUI_GaussPointsDlg() {}
void initFromPrsObject(VISU::GaussPoints_i* thePrs);
int storeToPrsObject(VISU::GaussPoints_i* thePrs);
protected slots:
void accept();
- void onBrowseMainTexture();
- void onBrowseAlphaTexture();
- void onColorButtonPressed();
-
private:
VisuGUI_GaussScalarBarPane* myScalarPane;
- QString myMainTexture;
- QString myAlphaTexture;
-
- QtxDblSpinBox* myClampSpinBox;
-
- QLineEdit* myMainTextureLineEdit;
- QLineEdit* myAlphaTextureLineEdit;
- QtxDblSpinBox* myAlphaThresholdSpinBox;
-
QRadioButton* myResultsButton;
QRadioButton* myGeometryButton;
- QLabel* mySizeLabel;
- QtxDblSpinBox* mySizeSpinBox;
- QLabel* myMinSizeLabel;
- QtxDblSpinBox* myMinSizeSpinBox;
- QLabel* myMaxSizeLabel;
- QtxDblSpinBox* myMaxSizeSpinBox;
-
- QtxDblSpinBox* myMagnificationSpinBox;
- QtxDblSpinBox* myIncrementSpinBox;
-
- QGroupBox* myColorGroup;
- QPushButton* myColorButton;
+ VVTK_PrimitiveBox* myPrimitiveBox;
+ VVTK_SizeBox* mySizeBox;
};
#endif // VISUGUI_GAUSSPOINTSDLS_H
createGaussPointsPreferences();
createScalarBarPreferences();
+ createInsideCursorPreferences();
createOutsideCursorPreferences();
createPickingPreferences();
createSpaceMousePreferences();
}
+//---------------------------------------------------------------
+void
+VisuGUI_Module
+::createInsideCursorPreferences()
+{
+ int insideCursorTab = addPreference( tr( "VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL" ) );
+
+ int primitiveGr = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL" ), insideCursorTab );
+ setPreferenceProperty( primitiveGr, "columns", 1 );
+
+ int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
+ SalomeApp_Preferences::Selector, "VISU", "inside_point_sprite_primitive_type" );
+
+ QStringList values;
+ values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
+ values.append( tr( "VISU_GAUSS_PREF_OPENGLPOINT" ) );
+ values.append( tr( "VISU_GAUSS_PREF_GEOMSPHERE" ) );
+ QValueList<QVariant> indices;
+ indices.append( 0 );
+ indices.append( 1 );
+ indices.append( 2 );
+ setPreferenceProperty( primitiveTypePref, "strings", values );
+ setPreferenceProperty( primitiveTypePref, "indexes", indices );
+
+ int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr,
+ SalomeApp_Preferences::IntSpin, "VISU", "inside_point_sprite_clamp" );
+ setPreferenceProperty( clampPref, "min", 1 );
+ setPreferenceProperty( clampPref, "max", 512 );
+
+ addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
+ SalomeApp_Preferences::File, "VISU", "inside_point_sprite_main_texture" );
+
+ addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
+ SalomeApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" );
+
+ int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
+ SalomeApp_Preferences::DblSpin, "VISU", "inside_point_sprite_alpha_threshold" );
+ setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
+ setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
+ setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
+
+ int sizeGr = addPreference( tr( "VISU_GAUSS_PREF_SIZE_GROUP_TTL" ), insideCursorTab );
+ setPreferenceProperty( sizeGr, "columns", 2 );
+
+ int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr,
+ SalomeApp_Preferences::IntSpin, "VISU", "inside_point_sprite_min_size" );
+ setPreferenceProperty( minSizePref, "min", 1 );
+ setPreferenceProperty( minSizePref, "max", 100 );
+
+ int maxSizePref = addPreference( tr( "VISU_GAUSS_PREF_MAX_SIZE" ), sizeGr,
+ SalomeApp_Preferences::IntSpin, "VISU", "inside_point_sprite_max_size" );
+ setPreferenceProperty( maxSizePref, "min", 1 );
+ setPreferenceProperty( maxSizePref, "max", 100 );
+
+ int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), sizeGr,
+ SalomeApp_Preferences::IntSpin, "VISU", "inside_point_sprite_magnification" );
+ setPreferenceProperty( magnificationPref, "min", 10 );
+ setPreferenceProperty( magnificationPref, "max", 1000 );
+
+ int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), sizeGr,
+ SalomeApp_Preferences::DblSpin, "VISU", "inside_point_sprite_increment" );
+ setPreferenceProperty( incrementPref, "min", 0.01 );
+ setPreferenceProperty( incrementPref, "max", 10 );
+ setPreferenceProperty( incrementPref, "step", 0.1 );
+
+}
+
+
//---------------------------------------------------------------
void
VisuGUI_Module
int primitiveGr = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL" ), outsideCursorTab );
setPreferenceProperty( primitiveGr, "columns", 1 );
+ int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
+ SalomeApp_Preferences::Selector, "VISU", "outside_point_sprite_primitive_type" );
+
+ QStringList values;
+ values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
+ values.append( tr( "VISU_GAUSS_PREF_OPENGLPOINT" ) );
+ values.append( tr( "VISU_GAUSS_PREF_GEOMSPHERE" ) );
+ QValueList<QVariant> indices;
+ indices.append( 0 );
+ indices.append( 1 );
+ indices.append( 2 );
+ setPreferenceProperty( primitiveTypePref, "strings", values );
+ setPreferenceProperty( primitiveTypePref, "indexes", indices );
+
int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr,
SalomeApp_Preferences::IntSpin, "VISU", "outside_point_sprite_clamp" );
setPreferenceProperty( clampPref, "min", 1 );
SalomeApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- SalomeApp_Preferences::DblSpin, "VISU", "outside_point_sprite_alpha_threshold" ); setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
+ SalomeApp_Preferences::DblSpin, "VISU", "outside_point_sprite_alpha_threshold" );
+ setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
setPreferenceProperty( sizePref, "max", 100 );
int colorGr = addPreference( tr( "VISU_GAUSS_PREF_COLOR_GROUP_TTL" ), outsideCursorTab );
+ setPreferenceProperty( colorGr, "columns", 1 );
+
+ addPreference( tr( "VISU_GAUSS_PREF_UNIFORM_COLOR" ), colorGr,
+ SalomeApp_Preferences::Bool, "VISU", "outside_point_sprite_uniform" );
addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), colorGr,
SalomeApp_Preferences::Color, "VISU", "outside_point_sprite_color" );
void
createScalarBarPreferences();
+ virtual
+ void
+ createInsideCursorPreferences();
+
virtual
void
createOutsideCursorPreferences();
float aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() );
SetSpacing( aSpacing );
+ int aPrimitiveType = aResourceMgr->integerValue( "VISU", "point_sprite_primitive_type", GetPrimitiveType() );
+ SetPrimitiveType( aPrimitiveType );
+
float aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() );
SetClamp( aClamp );
float aMaxSize = aResourceMgr->doubleValue( "VISU", "point_sprite_max_size", GetMaxSize() );
SetMaxSize( aMaxSize );
- float aConstSize = aResourceMgr->doubleValue( "VISU", "point_sprite_size", GetConstSize() );
- SetConstSize( aConstSize );
+ float aGeomSize = aResourceMgr->doubleValue( "VISU", "point_sprite_size", GetGeomSize() );
+ SetGeomSize( aGeomSize );
float aMagnification = aResourceMgr->doubleValue( "VISU", "point_sprite_magnification", GetMagnification() );
SetMagnification( aMagnification );
SetBiColor(Storable::FindValue(theMap,"myIsBiColor").toInt());
SetSpacing(Storable::FindValue(theMap,"mySpacing").toDouble());
+ SetPrimitiveType(Storable::FindValue(theMap,"myPrimitiveType").toInt());
SetClamp(Storable::FindValue(theMap,"myClamp").toDouble());
SetMinSize(Storable::FindValue(theMap,"myMinSize").toDouble());
SetMaxSize(Storable::FindValue(theMap,"myMaxSize").toDouble());
- SetConstSize(Storable::FindValue(theMap,"myConstSize").toDouble());
+ SetGeomSize(Storable::FindValue(theMap,"myGeomSize").toDouble());
SetMagnification(Storable::FindValue(theMap,"myMagnification").toDouble());
SetMagnificationIncrement(Storable::FindValue(theMap,"myMagnificationIncrement").toDouble());
Storable::DataToStream( theStr, "myIsBiColor", GetBiColor() );
Storable::DataToStream( theStr, "mySpacing", GetSpacing() );
+ Storable::DataToStream( theStr, "myPrimitiveType", GetPrimitiveType() );
Storable::DataToStream( theStr, "myClamp", GetClamp() );
Storable::DataToStream( theStr, "myMinSize", GetMinSize() );
Storable::DataToStream( theStr, "myMaxSize", GetMaxSize() );
- Storable::DataToStream( theStr, "myConstSize", GetConstSize() );
+ Storable::DataToStream( theStr, "myGeomSize", GetGeomSize() );
Storable::DataToStream( theStr, "myMagnification", GetMagnification() );
Storable::DataToStream( theStr, "myMagnificationIncrement", GetMagnificationIncrement() );
return myGaussPointsPL->GetAlphaThreshold();
}
+void
+VISU::GaussPoints_i
+::SetPrimitiveType(int thePrimitiveType)
+{
+ myGaussPointsPL->SetPrimitiveType( thePrimitiveType );
+}
+
+int
+VISU::GaussPoints_i
+::GetPrimitiveType()
+{
+ return myGaussPointsPL->GetPrimitiveType();
+}
+
float
VISU::GaussPoints_i
::GetMaximumSupportedSize()
void
VISU::GaussPoints_i
-::SetConstSize( float theConstSize )
+::SetGeomSize( float theGeomSize )
{
- myGaussPointsPL->SetSize( theConstSize );
+ myGaussPointsPL->SetSize( theGeomSize );
}
float
VISU::GaussPoints_i
-::GetConstSize()
+::GetGeomSize()
{
return myGaussPointsPL->GetSize();
}
float
GetAlphaThreshold();
+ void
+ SetPrimitiveType(int thePrimitiveType);
+
+ int
+ GetPrimitiveType();
+
float
GetMaximumSupportedSize();
GetClamp();
void
- SetConstSize(float theConstSize);
+ SetGeomSize(float theGeomSize);
float
- GetConstSize();
+ GetGeomSize();
void
SetMinSize(float theMinSize);
VVTK_InteractorStyle.h \
VVTK_PickingDlg.h \
VVTK_SegmentationCursorDlg.h \
+ VVTK_PrimitiveBox.h \
+ VVTK_SizeBox.h \
VVTK_ViewWindow.h \
VVTK_MainWindow.h
VVTK_InteractorStyle.cxx \
VVTK_PickingDlg.cxx \
VVTK_SegmentationCursorDlg.cxx \
+ VVTK_PrimitiveBox.cxx \
+ VVTK_SizeBox.cxx \
VVTK_ViewWindow.cxx \
VVTK_Renderer.cxx \
VVTK_MainWindow.cxx
VVTK_ViewManager.h \
VVTK_PickingDlg.h \
VVTK_SegmentationCursorDlg.h \
+ VVTK_PrimitiveBox.h \
+ VVTK_SizeBox.h \
VVTK_MainWindow.h
CPPFLAGS += \
#include <qtoolbar.h>
#include <qsplitter.h>
+#include <qfiledialog.h>
//----------------------------------------------------------------------------
VVTK_MainWindow
moveDockWindow(myToolBar,Qt::DockLeft);
myActionsMap[NonIsometric]->removeFrom(myToolBar);
+
+ // Recording
+ myRecordingToolBar = new QToolBar(this);
+ myRecordingToolBar->setCloseMode(QDockWindow::Undocked);
+ myRecordingToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+ moveDockWindow(myRecordingToolBar,Qt::DockLeft);
+
+ myStartAction = new QtxAction(tr("MNU_VVTK_RECORDING_START"),
+ theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_START" ) ),
+ tr( "MNU_VVTK_RECORDING_START" ), 0, this);
+ myStartAction->setStatusTip(tr("DSC_VVTK_RECORDING_START"));
+ myStartAction->addTo( myRecordingToolBar );
+ connect( myStartAction, SIGNAL( activated() ), this, SLOT( OnStartRecording() ) );
+
+ myPlayAction = new QtxAction(tr("MNU_VVTK_RECORDING_PLAY"),
+ theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PLAY" ) ),
+ tr( "MNU_VVTK_RECORDING_PLAY" ), 0, this);
+ myPlayAction->setStatusTip(tr("DSC_VVTK_RECORDING_PLAY"));
+ myPlayAction->setEnabled( false );
+ myPlayAction->addTo( myRecordingToolBar );
+ connect( myPlayAction, SIGNAL( activated() ), this, SLOT( OnPlayRecording() ) );
+
+ myPauseAction = new QtxAction(tr("MNU_VVTK_RECORDING_PAUSE"),
+ theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PAUSE" ) ),
+ tr( "MNU_VVTK_RECORDING_PAUSE" ), 0, this);
+ myPauseAction->setStatusTip(tr("DSC_VVTK_RECORDING_PAUSE"));
+ myPauseAction->setEnabled( false );
+ myPauseAction->addTo( myRecordingToolBar );
+ connect( myPauseAction, SIGNAL( activated() ), this, SLOT( OnPauseRecording() ) );
+
+ myStopAction = new QtxAction(tr("MNU_VVTK_RECORDING_STOP"),
+ theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_STOP" ) ),
+ tr( "MNU_VVTK_RECORDING_STOP" ), 0, this);
+ myStopAction->setStatusTip(tr("DSC_VVTK_RECORDING_STOP"));
+ myStopAction->setEnabled( false );
+ myStopAction->addTo( myRecordingToolBar );
+ connect( myStopAction, SIGNAL( activated() ), this, SLOT( OnStopRecording() ) );
}
void
SetSelectionMode(theIsSelectionOn? NodeSelection: ActorSelection);
}
+//----------------------------------------------------------------------------
+void
+VVTK_MainWindow
+::OnStartRecording()
+{
+ QString aFileName = QFileDialog::getOpenFileName( "/data/ouv/SALOME", "*.avi", this );
+ if( aFileName.isNull() )
+ return;
+
+ myStartAction->setEnabled( false );
+ myPlayAction->setEnabled( false );
+ myPauseAction->setEnabled( true );
+ myStopAction->setEnabled( true );
+}
+
+//----------------------------------------------------------------------------
+void
+VVTK_MainWindow
+::OnPlayRecording()
+{
+ myStartAction->setEnabled( false );
+ myPlayAction->setEnabled( false );
+ myPauseAction->setEnabled( true );
+ myStopAction->setEnabled( true );
+}
+
+//----------------------------------------------------------------------------
+void
+VVTK_MainWindow
+::OnPauseRecording()
+{
+ myStartAction->setEnabled( false );
+ myPlayAction->setEnabled( true );
+ myPauseAction->setEnabled( false );
+ myStopAction->setEnabled( true );
+}
+
+//----------------------------------------------------------------------------
+void
+VVTK_MainWindow
+::OnStopRecording()
+{
+ myStartAction->setEnabled( true );
+ myPlayAction->setEnabled( false );
+ myPauseAction->setEnabled( false );
+ myStopAction->setEnabled( false );
+}
+
//----------------------------------------------------------------------------
int
convertAction( const int accelAction );
myPickingDlg->SetAction( anAction );
myInteractorStyle->SetPickingSettings(myPickingDlg->GetPickingSettings());
+ // Plane/Sphere Segmentation
aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_PLANE_SEGMENTATION_SWITCH"));
- anAction = new QtxAction(tr("MNU_VVTK_PLANE_SEGMENTATION_SWITCH"),
- aPixmap,
- tr( "MNU_VVTK_PLANE_SEGMENTATION_SWITCH" ),
- 0,
- this,
- "VVTK/SVTK PlaneSegmentationSwitch",
- true);
- anAction->setToggleAction(true);
- anAction->setStatusTip(tr("DSC_VVTK_PLANE_SEGMENTATION_SWITCH"));
- connect(anAction, SIGNAL(toggled(bool)), this, SLOT(OnPlaneSegmentationSwitch(bool)));
- anAction->addTo( myPtsToolBar );
+ myPlaneSegmentationAction = new QtxAction(tr("MNU_VVTK_PLANE_SEGMENTATION_SWITCH"),
+ aPixmap,
+ tr( "MNU_VVTK_PLANE_SEGMENTATION_SWITCH" ),
+ 0,
+ this,
+ "VVTK/SVTK PlaneSegmentationSwitch",
+ true);
+ myPlaneSegmentationAction->setToggleAction(true);
+ myPlaneSegmentationAction->setStatusTip(tr("DSC_VVTK_PLANE_SEGMENTATION_SWITCH"));
+ myPlaneSegmentationAction->addTo( myPtsToolBar );
+ connect( myPlaneSegmentationAction, SIGNAL( toggled( bool ) ), this, SLOT( OnSegmentationSwitch( bool ) ) );
+
+ aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SPHERE_SEGMENTATION_SWITCH"));
+ mySphereSegmentationAction = new QtxAction(tr("MNU_VVTK_SPHERE_SEGMENTATION_SWITCH"),
+ aPixmap,
+ tr( "MNU_VVTK_SPHERE_SEGMENTATION_SWITCH" ),
+ 0,
+ this,
+ "VVTK/SVTK SphereSegmentationSwitch",
+ true);
+ mySphereSegmentationAction->setToggleAction(true);
+ mySphereSegmentationAction->setStatusTip(tr("DSC_VVTK_SPHERE_SEGMENTATION_SWITCH"));
+ mySphereSegmentationAction->addTo( myPtsToolBar );
+ connect( mySphereSegmentationAction, SIGNAL( toggled( bool ) ), this, SLOT( OnSegmentationSwitch( bool ) ) );
mySegmentationCursorDlg = new VVTK_SegmentationCursorDlg( this, "SegmentationCursorDlg" );
- mySegmentationCursorDlg->SetAction( anAction );
+ mySegmentationCursorDlg->SetPlaneAction( myPlaneSegmentationAction );
+ mySegmentationCursorDlg->SetSphereAction( mySphereSegmentationAction );
}
void
return myRenderer->GetImplicitFunctionWidget();
}
+VISU_InsideCursorSettings*
+VVTK_MainWindow1
+::GetInsideCursorSettings()
+{
+ return mySegmentationCursorDlg->GetInsideCursorSettings();
+}
+
VISU_OutsideCursorSettings*
VVTK_MainWindow1
::GetOutsideCursorSettings()
//----------------------------------------------------------------------------
void
VVTK_MainWindow1
-::OnPlaneSegmentationSwitch(bool theIsPlaneSegmentationOn)
+::OnSegmentationSwitch(bool theIsSegmentationOn)
{
- myRenderer->GetImplicitFunctionWidget()->SetEnabled(theIsPlaneSegmentationOn);
- //mySplitter->setCollapsible(this,!theIsPlaneSegmentationOn);
+ QtxAction* anAction = ( QtxAction* )sender();
+ if( !anAction )
+ return;
+
+ myRenderer->GetImplicitFunctionWidget()->SetEnabled(theIsSegmentationOn);
+
+ if( anAction == myPlaneSegmentationAction && theIsSegmentationOn )
+ mySphereSegmentationAction->setOn( false );
+ else if( anAction == mySphereSegmentationAction && theIsSegmentationOn )
+ myPlaneSegmentationAction->setOn( false );
- if( theIsPlaneSegmentationOn )
+ if( theIsSegmentationOn )
{
myMainWindow2->show();
+ mySegmentationCursorDlg->SetIsPlaneSegmentation( anAction == myPlaneSegmentationAction );
mySegmentationCursorDlg->UpdateSegmentation();
- mySegmentationCursorDlg->UpdateOutsideCursor();
+ mySegmentationCursorDlg->UpdateInsideGaussPoints();
+ mySegmentationCursorDlg->UpdateOutsideGaussPoints();
mySegmentationCursorDlg->show();
}
else
class VISU_ImplicitFunctionWidget;
class VVTK_SegmentationCursorDlg;
+class VISU_InsideCursorSettings;
class VISU_OutsideCursorSettings;
class VISU_PickingSettings;
class VVTK_InteractorStyle;
void
action( const int );
+ virtual
+ void
+ OnStartRecording();
+
+ virtual
+ void
+ OnPlayRecording();
+
+ virtual
+ void
+ OnPauseRecording();
+
+ virtual
+ void
+ OnStopRecording();
+
protected:
vtkSmartPointer<VVTK_InteractorStyle> myInteractorStyle;
+
+ QToolBar* myRecordingToolBar;
+ QtxAction* myStartAction;
+ QtxAction* myPlayAction;
+ QtxAction* myPauseAction;
+ QtxAction* myStopAction;
};
VISU_ImplicitFunctionWidget*
GetImplicitFunctionWidget();
+ VISU_InsideCursorSettings*
+ GetInsideCursorSettings();
+
VISU_OutsideCursorSettings*
GetOutsideCursorSettings();
public slots:
void
- OnPlaneSegmentationSwitch(bool theIsPlaneSegmentationOn);
+ OnSegmentationSwitch(bool theIsSegmentationOn);
virtual
void
QToolBar* myPtsToolBar;
QSplitter* mySplitter;
+ QtxAction* myPlaneSegmentationAction;
+ QtxAction* mySphereSegmentationAction;
+
VVTK_SegmentationCursorDlg* mySegmentationCursorDlg;
VVTK_PickingDlg* myPickingDlg;
};
if( !myPickingSettings->GetInitial() )
{
myPyramidHeightSpinBox->setValue( myPickingSettings->GetPyramidHeight() );
- myTransparencySpinBox->setValue( myPickingSettings->GetInfoWindowTransparency() * 100.0 );
+ myTransparencySpinBox->setValue( ( int )myPickingSettings->GetInfoWindowTransparency() * 100 );
myPositionComboBox->setCurrentItem( myPickingSettings->GetInfoWindowPosition() );
myZoomFactorSpinBox->setValue( myPickingSettings->GetZoomFactor() );
myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() );
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 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 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
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : VVTK_PrimitiveBox.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+
+#include "VVTK_PrimitiveBox.h"
+
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+
+#include "QtxDblSpinBox.h"
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qbuttongroup.h>
+#include <qradiobutton.h>
+#include <qpushbutton.h>
+#include <qfiledialog.h>
+
+#include <iostream.h>
+
+using namespace std;
+
+VVTK_PrimitiveBox::VVTK_PrimitiveBox( QWidget* parent ) :
+ QGroupBox( parent )
+{
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+
+ setTitle( tr( "PRIMITIVE_TITLE" ) );
+ setColumnLayout(0, Qt::Vertical );
+ layout()->setSpacing( 0 );
+ layout()->setMargin( 0 );
+
+ QGridLayout* aLayout = new QGridLayout( layout() );
+ aLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ aLayout->setSpacing(6);
+ aLayout->setMargin(11);
+
+ myPrimitiveType = VVTK_PrimitiveBox::PointSprite;
+
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/";
+ myMainTexture = aRootDir + "sprite_texture.bmp";
+ myAlphaTexture = aRootDir + "sprite_alpha.bmp";
+
+ // Primitive Type
+ QButtonGroup* aPrimitiveTypeGroup = new QButtonGroup( 3, Qt::Horizontal, this, "PrimitiveTypeGroup" );
+ aPrimitiveTypeGroup->setMinimumWidth( 450 );
+ aPrimitiveTypeGroup->setRadioButtonExclusive( true );
+ aPrimitiveTypeGroup->setFrameStyle( QFrame::NoFrame );
+ aPrimitiveTypeGroup->layout()->setMargin( 0 );
+
+ myPointSpriteButton = new QRadioButton( tr( "POINT_SPRITE" ), aPrimitiveTypeGroup );
+ myOpenGLPointButton = new QRadioButton( tr( "OPENGL_POINT" ), aPrimitiveTypeGroup );
+ myGeomSphereButton = new QRadioButton( tr( "GEOMETRICAL_SPHERE" ), aPrimitiveTypeGroup );
+
+ aLayout->addMultiCellWidget( aPrimitiveTypeGroup, 0, 0, 0, 2 );
+
+ // Clamp
+ myClampLabel = new QLabel( tr( "CLAMP" ), this );
+ myClampSpinBox = new QtxDblSpinBox( 1.0, 512.0, 1.0, this );
+ myClampSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ aLayout->addWidget( myClampLabel, 1, 0 );
+ aLayout->addMultiCellWidget( myClampSpinBox, 1, 1, 1, 2 );
+
+ // Main Texture
+ myMainTextureLabel = new QLabel( tr( "MAIN_TEXTURE" ), this );
+ myMainTextureLineEdit = new QLineEdit( this );
+ myMainTextureButton = new QPushButton( this );
+ myMainTextureButton->setAutoDefault( false );
+ myMainTextureButton->setPixmap( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
+ connect( myMainTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseMainTexture() ) );
+
+ aLayout->addWidget( myMainTextureLabel, 2, 0 );
+ aLayout->addWidget( myMainTextureLineEdit, 2, 1 );
+ aLayout->addWidget( myMainTextureButton, 2, 2 );
+
+ // Alpha Texture
+ myAlphaTextureLabel = new QLabel( tr( "ALPHA_TEXTURE" ), this );
+ myAlphaTextureLineEdit = new QLineEdit( this );
+ myAlphaTextureButton = new QPushButton( this );
+ myAlphaTextureButton->setAutoDefault( false );
+ myAlphaTextureButton->setPixmap( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
+ connect( myAlphaTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseAlphaTexture() ) );
+
+ aLayout->addWidget( myAlphaTextureLabel, 3, 0 );
+ aLayout->addWidget( myAlphaTextureLineEdit, 3, 1 );
+ aLayout->addWidget( myAlphaTextureButton, 3, 2 );
+
+ // Alpha Threshold
+ myAlphaThresholdLabel = new QLabel( tr( "ALPHA_THRESHOLD" ), this );
+ myAlphaThresholdSpinBox = new QtxDblSpinBox( 0.0, 1.0, 0.1, this );
+ myAlphaThresholdSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ aLayout->addWidget( myAlphaThresholdLabel, 4, 0 );
+ aLayout->addMultiCellWidget( myAlphaThresholdSpinBox, 4, 4, 1, 2 );
+
+ connect( myPointSpriteButton, SIGNAL( clicked() ), this, SLOT( onTogglePointSprite() ) );
+ connect( myOpenGLPointButton, SIGNAL( clicked() ), this, SLOT( onToggleOpenGLPoint() ) );
+ connect( myGeomSphereButton, SIGNAL( clicked() ), this, SLOT( onToggleGeomSphere() ) );
+}
+
+void VVTK_PrimitiveBox::onTogglePointSprite()
+{
+ myPrimitiveType = VVTK_PrimitiveBox::PointSprite;
+
+ myClampLabel->show();
+ myClampSpinBox->show();
+
+ myMainTextureLabel->show();
+ myMainTextureLineEdit->show();
+ myMainTextureButton->show();
+
+ myAlphaTextureLabel->show();
+ myAlphaTextureLineEdit->show();
+ myAlphaTextureButton->show();
+
+ myAlphaThresholdLabel->show();
+ myAlphaThresholdSpinBox->show();
+}
+
+void VVTK_PrimitiveBox::onToggleOpenGLPoint()
+{
+ myPrimitiveType = VVTK_PrimitiveBox::OpenGLPoint;
+
+ myClampLabel->show();
+ myClampSpinBox->show();
+
+ myMainTextureLabel->hide();
+ myMainTextureLineEdit->hide();
+ myMainTextureButton->hide();
+
+ myAlphaTextureLabel->hide();
+ myAlphaTextureLineEdit->hide();
+ myAlphaTextureButton->hide();
+
+ myAlphaThresholdLabel->hide();
+ myAlphaThresholdSpinBox->hide();
+}
+
+void VVTK_PrimitiveBox::onToggleGeomSphere()
+{
+ myPrimitiveType = VVTK_PrimitiveBox::GeomSphere;
+
+ myClampLabel->hide();
+ myClampSpinBox->hide();
+
+ myMainTextureLabel->hide();
+ myMainTextureLineEdit->hide();
+ myMainTextureButton->hide();
+
+ myAlphaTextureLabel->hide();
+ myAlphaTextureLineEdit->hide();
+ myAlphaTextureButton->hide();
+
+ myAlphaThresholdLabel->hide();
+ myAlphaThresholdSpinBox->hide();
+}
+
+void VVTK_PrimitiveBox::setPrimitiveType( int theType )
+{
+ myPrimitiveType = theType;
+
+ switch( myPrimitiveType )
+ {
+ case VVTK_PrimitiveBox::PointSprite :
+ myPointSpriteButton->setChecked( true );
+ onTogglePointSprite();
+ break;
+ case VVTK_PrimitiveBox::OpenGLPoint :
+ myOpenGLPointButton->setChecked( true );
+ onToggleOpenGLPoint();
+ break;
+ case VVTK_PrimitiveBox::GeomSphere :
+ myGeomSphereButton->setChecked( true );
+ onToggleGeomSphere();
+ break;
+ default : break;
+ }
+}
+
+float VVTK_PrimitiveBox::getClamp() const
+{
+ return myClampSpinBox->value();
+}
+
+void VVTK_PrimitiveBox::setClamp( float theClamp )
+{
+ myClampSpinBox->setValue( theClamp );
+}
+
+void VVTK_PrimitiveBox::setClampMaximum( float theClampMaximum )
+{
+ myClampSpinBox->setMaxValue( theClampMaximum );
+}
+
+void VVTK_PrimitiveBox::setMainTexture( const QString& theMainTexture )
+{
+ myMainTexture = theMainTexture;
+ myMainTextureLineEdit->setText( theMainTexture.section( '/', -1 ) );
+}
+
+void VVTK_PrimitiveBox::setAlphaTexture( const QString& theAlphaTexture )
+{
+ myAlphaTexture = theAlphaTexture;
+ myAlphaTextureLineEdit->setText( theAlphaTexture.section( '/', -1 ) );
+}
+
+float VVTK_PrimitiveBox::getAlphaThreshold() const
+{
+ return myAlphaThresholdSpinBox->value();
+}
+
+void VVTK_PrimitiveBox::setAlphaThreshold( float theAlphaThreshold )
+{
+ myAlphaThresholdSpinBox->setValue( theAlphaThreshold );
+}
+
+void VVTK_PrimitiveBox::onBrowseMainTexture()
+{
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/";
+ QString aFileName = QFileDialog::getOpenFileName( aRootDir, "Bitmap (*.bmp *.jpg *.png)", this );
+
+ if( aFileName.isNull() )
+ return;
+
+ myMainTexture = aFileName;
+ myMainTextureLineEdit->setText( aFileName.section( '/', -1 ) );
+}
+
+void VVTK_PrimitiveBox::onBrowseAlphaTexture()
+{
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/";
+ QString aFileName = QFileDialog::getOpenFileName( aRootDir, "Bitmap (*.bmp *.jpg *.png)", this );
+
+ if( aFileName.isNull() )
+ return;
+
+ myAlphaTexture = aFileName;
+ myAlphaTextureLineEdit->setText( aFileName.section( '/', -1 ) );
+}
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 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 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
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : VVTK_PrimitiveBox.h
+// Author : Oleg UVAROV
+// Module : VISU
+
+#ifndef VVTK_PRIMITIVEBOX_H
+#define VVTK_PRIMITIVEBOX_H
+
+#include <qgroupbox.h>
+
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QRadioButton;
+
+class QtxDblSpinBox;
+
+class VVTK_PrimitiveBox : public QGroupBox
+{
+ Q_OBJECT
+
+public:
+ enum { PointSprite = 0, OpenGLPoint, GeomSphere };
+
+public:
+ VVTK_PrimitiveBox( QWidget* );
+ ~VVTK_PrimitiveBox() {}
+
+public:
+ int getPrimitiveType() const { return myPrimitiveType; }
+ void setPrimitiveType( int );
+
+ float getClamp() const;
+ void setClamp( float );
+ void setClampMaximum( float );
+
+ QString getMainTexture() const { return myMainTexture; }
+ void setMainTexture( const QString& );
+
+ QString getAlphaTexture() const { return myAlphaTexture; }
+ void setAlphaTexture( const QString& );
+
+ float getAlphaThreshold() const;
+ void setAlphaThreshold( float );
+
+protected slots:
+ void onTogglePointSprite();
+ void onToggleOpenGLPoint();
+ void onToggleGeomSphere();
+
+ void onBrowseMainTexture();
+ void onBrowseAlphaTexture();
+
+private:
+ int myPrimitiveType;
+
+ QRadioButton* myPointSpriteButton;
+ QRadioButton* myOpenGLPointButton;
+ QRadioButton* myGeomSphereButton;
+
+ QString myMainTexture;
+ QString myAlphaTexture;
+
+ QLabel* myClampLabel;
+ QtxDblSpinBox* myClampSpinBox;
+
+ QLabel* myMainTextureLabel;
+ QLineEdit* myMainTextureLineEdit;
+ QPushButton* myMainTextureButton;
+
+ QLabel* myAlphaTextureLabel;
+ QLineEdit* myAlphaTextureLineEdit;
+ QPushButton* myAlphaTextureButton;
+
+ QLabel* myAlphaThresholdLabel;
+ QtxDblSpinBox* myAlphaThresholdSpinBox;
+};
+
+
+
+#endif
VVTK_Renderer
::VVTK_Renderer():
myFPSActor(VISU_FPSActor::New()),
+ myInsideCursorSettings(NULL),
myPickingSettings(NULL)
{
if(MYDEBUG) INFOS("VVTK_Renderer() - "<<this);
::AddActor(VTKViewer_Actor* theActor)
{
if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
+ anActor->SetInsideCursorSettings(myInsideCursorSettings);
anActor->SetPickingSettings(myPickingSettings);
Superclass::AddActor(anActor);
}
::RemoveActor(VTKViewer_Actor* theActor)
{
using namespace VISU;
- if(VISU_GaussPtsAct1* anActor = dynamic_cast<VISU_GaussPtsAct1*>(theActor)){
+ if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
+ anActor->SetInsideCursorSettings(NULL);
anActor->SetPickingSettings(NULL);
Superclass::RemoveActor(theActor);
}
}
+//----------------------------------------------------------------------------
+void
+VVTK_Renderer
+::SetInsideCursorSettings(VISU_InsideCursorSettings* theInsideCursorSettings)
+{
+ myInsideCursorSettings = theInsideCursorSettings;
+}
+
//----------------------------------------------------------------------------
void
VVTK_Renderer
#include "SVTK_Renderer.h"
class VISU_ImplicitFunctionWidget;
+class VISU_InsideCursorSettings;
class VISU_OutsideCursorSettings;
class VISU_PickingSettings;
class VISU_FPSActor;
void
RemoveActor(VTKViewer_Actor* theActor);
+ void
+ SetInsideCursorSettings(VISU_InsideCursorSettings* theInsideCursorSettings);
+
void
SetPickingSettings(VISU_PickingSettings* thePickingSettings);
VVTK_Renderer();
~VVTK_Renderer();
+ VISU_InsideCursorSettings* myInsideCursorSettings;
VISU_PickingSettings* myPickingSettings;
vtkSmartPointer<VISU_FPSActor> myFPSActor;
};
// Module : VISU
#include "VVTK_SegmentationCursorDlg.h"
+#include "VVTK_PrimitiveBox.h"
+#include "VVTK_SizeBox.h"
#include "VISU_GaussPtsAct.h"
#include "VISU_GaussPtsSettings.h"
VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const char* name )
:QDialog( parent, name, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
myEventCallbackCommand( vtkCallbackCommand::New() ),
- myOutsideCursorSettings( VISU_OutsideCursorSettings::New() )
+ myInsideCursorSettings( VISU_InsideCursorSettings::New() ),
+ myOutsideCursorSettings( VISU_OutsideCursorSettings::New() ),
+ myIsPlaneSegmentation( true )
{
myPriority = 0.0;
myEventCallbackCommand->Delete();
mySegmentationCursorBox = new QVBox( this );
mySegmentationCursorBox->setMargin(11);
mySegmentationCursorBox->setSpacing(6);
+ mySegmentationCursorBox->layout()->setAlignment(Qt::AlignTop);
// Origin
- QGroupBox* OriginGroup = new QGroupBox( tr( "ORIGIN_TITLE" ), mySegmentationCursorBox, "OriginGroup" );
- OriginGroup->setColumnLayout( 0, Qt::Vertical );
- OriginGroup->layout()->setSpacing( 0 );
- OriginGroup->layout()->setMargin( 0 );
+ myOriginGroup = new QGroupBox( tr( "ORIGIN_TITLE" ), mySegmentationCursorBox, "OriginGroup" );
+ myOriginGroup->setColumnLayout( 0, Qt::Vertical );
+ myOriginGroup->layout()->setSpacing( 0 );
+ myOriginGroup->layout()->setMargin( 0 );
- QGridLayout* OriginGroupLayout = new QGridLayout( OriginGroup->layout() );
+ QGridLayout* OriginGroupLayout = new QGridLayout( myOriginGroup->layout() );
OriginGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
OriginGroupLayout->setSpacing(6);
OriginGroupLayout->setMargin(11);
- QLabel* XOriginLabel = new QLabel( tr( "ORIGIN_X" ), OriginGroup );
- myXOriginSpinBox = new QtxDblSpinBox( -1000.0, 1000.0, 0.1, OriginGroup );
+ QLabel* XOriginLabel = new QLabel( tr( "ORIGIN_X" ), myOriginGroup );
+ myXOriginSpinBox = new QtxDblSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup );
myXOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myXOriginSpinBox->setMinimumWidth( 100 );
myXOriginSpinBox->setValue( 0.0 );
- QLabel* YOriginLabel = new QLabel( tr( "ORIGIN_Y" ), OriginGroup );
- myYOriginSpinBox = new QtxDblSpinBox( -1000.0, 1000.0, 0.1, OriginGroup );
+ QLabel* YOriginLabel = new QLabel( tr( "ORIGIN_Y" ), myOriginGroup );
+ myYOriginSpinBox = new QtxDblSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup );
myYOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myYOriginSpinBox->setMinimumWidth( 100 );
myYOriginSpinBox->setValue( 0.0 );
- QLabel* ZOriginLabel = new QLabel( tr( "ORIGIN_Z" ), OriginGroup );
- myZOriginSpinBox = new QtxDblSpinBox( -1000.0, 1000.0, 0.1, OriginGroup );
+ QLabel* ZOriginLabel = new QLabel( tr( "ORIGIN_Z" ), myOriginGroup );
+ myZOriginSpinBox = new QtxDblSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup );
myZOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myZOriginSpinBox->setMinimumWidth( 100 );
myZOriginSpinBox->setValue( 0.0 );
OriginGroupLayout->addWidget( ZOriginLabel, 0, 4 );
OriginGroupLayout->addWidget( myZOriginSpinBox, 0, 5 );
- // Direction
- QGroupBox* DirectionGroup = new QGroupBox( tr( "DIRECTION_TITLE" ), mySegmentationCursorBox, "DirectionGroup" );
- DirectionGroup->setColumnLayout( 0, Qt::Vertical );
- DirectionGroup->layout()->setSpacing( 0 );
- DirectionGroup->layout()->setMargin( 0 );
+ // Direction ( Plane Segmentation )
+ myDirectionGroup = new QGroupBox( tr( "DIRECTION_TITLE" ), mySegmentationCursorBox, "DirectionGroup" );
+ myDirectionGroup->setColumnLayout( 0, Qt::Vertical );
+ myDirectionGroup->layout()->setSpacing( 0 );
+ myDirectionGroup->layout()->setMargin( 0 );
- QGridLayout* DirectionGroupLayout = new QGridLayout( DirectionGroup->layout() );
+ QGridLayout* DirectionGroupLayout = new QGridLayout( myDirectionGroup->layout() );
DirectionGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
DirectionGroupLayout->setSpacing(6);
DirectionGroupLayout->setMargin(11);
- QLabel* DXDirectionLabel = new QLabel( tr( "DIRECTION_DX" ), DirectionGroup );
- myDXDirectionSpinBox = new QtxDblSpinBox( -1.0, 1.0, 0.1, DirectionGroup );
+ QLabel* DXDirectionLabel = new QLabel( tr( "DIRECTION_DX" ), myDirectionGroup );
+ myDXDirectionSpinBox = new QtxDblSpinBox( -1.0, 1.0, 0.1, myDirectionGroup );
myDXDirectionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myDXDirectionSpinBox->setMinimumWidth( 100 );
myDXDirectionSpinBox->setValue( 0.0 );
- QLabel* DYDirectionLabel = new QLabel( tr( "DIRECTION_DY" ), DirectionGroup );
- myDYDirectionSpinBox = new QtxDblSpinBox( -1.0, 1.0, 0.1, DirectionGroup );
+ QLabel* DYDirectionLabel = new QLabel( tr( "DIRECTION_DY" ), myDirectionGroup );
+ myDYDirectionSpinBox = new QtxDblSpinBox( -1.0, 1.0, 0.1, myDirectionGroup );
myDYDirectionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myDYDirectionSpinBox->setMinimumWidth( 100 );
myDYDirectionSpinBox->setValue( 0.0 );
- QLabel* DZDirectionLabel = new QLabel( tr( "DIRECTION_DZ" ), DirectionGroup );
- myDZDirectionSpinBox = new QtxDblSpinBox( -1.0, 1.0, 0.1, DirectionGroup );
+ QLabel* DZDirectionLabel = new QLabel( tr( "DIRECTION_DZ" ), myDirectionGroup );
+ myDZDirectionSpinBox = new QtxDblSpinBox( -1.0, 1.0, 0.1, myDirectionGroup );
myDZDirectionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myDZDirectionSpinBox->setMinimumWidth( 100 );
myDZDirectionSpinBox->setValue( 1.0 );
DirectionGroupLayout->addWidget( DZDirectionLabel, 0, 4 );
DirectionGroupLayout->addWidget( myDZDirectionSpinBox, 0, 5 );
- // Depth
- QGroupBox* DepthGroup = new QGroupBox( tr( "DEPTH_TITLE" ), mySegmentationCursorBox, "DepthGroup" );
- DepthGroup->setColumnLayout( 0, Qt::Vertical );
- DepthGroup->layout()->setSpacing( 0 );
- DepthGroup->layout()->setMargin( 0 );
+ // Depth ( Plane Segmentation )
+ myDepthGroup = new QGroupBox( tr( "DEPTH_TITLE" ), mySegmentationCursorBox, "DepthGroup" );
+ myDepthGroup->setColumnLayout( 0, Qt::Vertical );
+ myDepthGroup->layout()->setSpacing( 0 );
+ myDepthGroup->layout()->setMargin( 0 );
- QGridLayout* DepthGroupLayout = new QGridLayout( DepthGroup->layout() );
+ QGridLayout* DepthGroupLayout = new QGridLayout( myDepthGroup->layout() );
DepthGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
DepthGroupLayout->setSpacing(6);
DepthGroupLayout->setMargin(11);
- QLabel* DepthLabel = new QLabel( tr( "DEPTH" ), DepthGroup );
- myDepthSpinBox = new QtxDblSpinBox( 0.0, VTK_LARGE_FLOAT, 0.1, DepthGroup );
+ QLabel* DepthLabel = new QLabel( tr( "DEPTH" ), myDepthGroup );
+ myDepthSpinBox = new QtxDblSpinBox( 0.0, VTK_LARGE_FLOAT, 0.1, myDepthGroup );
myDepthSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myDepthSpinBox->setMinimumWidth( 100 );
- myDepthSpinBox->setValue( 10.0 );
+ myDepthSpinBox->setValue( 1.0 );
DepthGroupLayout->addWidget( DepthLabel, 0, 0 );
DepthGroupLayout->addWidget( myDepthSpinBox, 0, 1 );
+ // Radius ( Sphere Segmentation )
+ myRadiusGroup = new QGroupBox( tr( "RADIUS_TITLE" ), mySegmentationCursorBox, "RadiusGroup" );
+ myRadiusGroup->setColumnLayout( 0, Qt::Vertical );
+ myRadiusGroup->layout()->setSpacing( 0 );
+ myRadiusGroup->layout()->setMargin( 0 );
- myTabBox->addTab( mySegmentationCursorBox, tr("SEGMENTATION_CURSOR_TAB") );
+ QGridLayout* RadiusGroupLayout = new QGridLayout( myRadiusGroup->layout() );
+ RadiusGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ RadiusGroupLayout->setSpacing(6);
+ RadiusGroupLayout->setMargin(11);
+ QLabel* RadiusLabel = new QLabel( tr( "RADIUS" ),myRadiusGroup );
+ myRadiusSpinBox = new QtxDblSpinBox( 0.0, 1000.0, 1.0,myRadiusGroup );
+ myRadiusSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myRadiusSpinBox->setMinimumWidth( 100 );
+ myRadiusSpinBox->setValue( 100.0 );
- // Outside cursor pane
- myOutsideCursorBox = new QVBox( this );
- myOutsideCursorBox->setMargin(11);
- myOutsideCursorBox->setSpacing(6);
+ QLabel* RatioLabel = new QLabel( tr( "RATIO" ), myRadiusGroup );
+ myRatioSpinBox = new QtxDblSpinBox( 0.1, 10.0, 0.1,myRadiusGroup );
+ myRatioSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myRatioSpinBox->setMinimumWidth( 100 );
+ myRatioSpinBox->setValue( 2.0 );
- // Primitive
- QGroupBox* PrimitiveGroup = new QGroupBox( tr( "PRIMITIVE_TITLE" ), myOutsideCursorBox, "PrimitiveGroup" );
- PrimitiveGroup->setColumnLayout(0, Qt::Vertical );
- PrimitiveGroup->layout()->setSpacing( 0 );
- PrimitiveGroup->layout()->setMargin( 0 );
-
- QGridLayout* PrimitiveGroupLayout = new QGridLayout (PrimitiveGroup->layout());
- PrimitiveGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- PrimitiveGroupLayout->setSpacing(6);
- PrimitiveGroupLayout->setMargin(11);
-
- // Primitive Type
- QButtonGroup* PrimitiveTypeGroup = new QButtonGroup( 3, Qt::Horizontal, PrimitiveGroup, "PrimitiveTypeGroup" );
- PrimitiveTypeGroup->setRadioButtonExclusive( true );
- PrimitiveTypeGroup->setFrameStyle( QFrame::NoFrame );
- PrimitiveTypeGroup->layout()->setMargin( 0 );
-
- QRadioButton* PointSpriteButton = new QRadioButton( tr( "POINT_SPRITE" ), PrimitiveTypeGroup );
- PointSpriteButton->setChecked( true );
-
- QRadioButton* OpenGLPointButton = new QRadioButton( tr( "OPENGL_POINT" ), PrimitiveTypeGroup );
- OpenGLPointButton->setEnabled( false );
-
- QRadioButton* GeometricalSphereButton = new QRadioButton( tr( "GEOMETRICAL_SPHERE" ), PrimitiveTypeGroup );
- GeometricalSphereButton->setEnabled( false );
-
- PrimitiveGroupLayout->addMultiCellWidget( PrimitiveTypeGroup, 0, 0, 0, 2 );
-
- // Clamp
- QLabel* ClampLabel = new QLabel( tr( "MAXIMUM_SIZE" ), PrimitiveGroup );
- myClampSpinBox = new QtxDblSpinBox( 1.0, 512.0, 1.0, PrimitiveGroup );
- myClampSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- PrimitiveGroupLayout->addWidget( ClampLabel, 1, 0 );
- PrimitiveGroupLayout->addMultiCellWidget( myClampSpinBox, 1, 1, 1, 2 );
-
- // Main Texture
- QLabel* MainTextureLabel = new QLabel( tr( "MAIN_TEXTURE" ), PrimitiveGroup );
- myMainTextureLineEdit = new QLineEdit( PrimitiveGroup );
- QPushButton* MainTextureButton = new QPushButton( PrimitiveGroup );
- MainTextureButton->setAutoDefault( false );
- MainTextureButton->setPixmap( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
- connect( MainTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseMainTexture() ) );
-
- PrimitiveGroupLayout->addWidget( MainTextureLabel, 2, 0 );
- PrimitiveGroupLayout->addWidget( myMainTextureLineEdit, 2, 1 );
- PrimitiveGroupLayout->addWidget( MainTextureButton, 2, 2 );
-
- // Alpha Texture
- QLabel* AlphaTextureLabel = new QLabel( tr( "ALPHA_TEXTURE" ), PrimitiveGroup );
- myAlphaTextureLineEdit = new QLineEdit( PrimitiveGroup );
- QPushButton* AlphaTextureButton = new QPushButton( PrimitiveGroup );
- AlphaTextureButton->setAutoDefault( false );
- AlphaTextureButton->setPixmap( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
- connect( AlphaTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseAlphaTexture() ) );
-
- PrimitiveGroupLayout->addWidget( AlphaTextureLabel, 3, 0 );
- PrimitiveGroupLayout->addWidget( myAlphaTextureLineEdit, 3, 1 );
- PrimitiveGroupLayout->addWidget( AlphaTextureButton, 3, 2 );
-
- // Alpha Threshold
- QLabel* AlphaThresholdLabel = new QLabel( tr( "ALPHA_THRESHOLD" ), PrimitiveGroup );
- myAlphaThresholdSpinBox = new QtxDblSpinBox( 0.0, 1.0, 0.1, PrimitiveGroup );
- myAlphaThresholdSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- PrimitiveGroupLayout->addWidget( AlphaThresholdLabel, 4, 0 );
- PrimitiveGroupLayout->addMultiCellWidget( myAlphaThresholdSpinBox, 4, 4, 1, 2 );
+ RadiusGroupLayout->addWidget( RadiusLabel, 0, 0 );
+ RadiusGroupLayout->addWidget( myRadiusSpinBox, 0, 1 );
+ RadiusGroupLayout->addWidget( RatioLabel, 0, 2 );
+ RadiusGroupLayout->addWidget( myRatioSpinBox, 0, 3 );
- // Size
- QGroupBox* SizeGroup = new QGroupBox ( tr( "SIZE_TITLE" ), myOutsideCursorBox, "SizeGroup" );
- SizeGroup->setColumnLayout(0, Qt::Vertical );
- SizeGroup->layout()->setSpacing( 0 );
- SizeGroup->layout()->setMargin( 0 );
- QGridLayout* SizeGroupLayout = new QGridLayout (SizeGroup->layout());
- SizeGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- SizeGroupLayout->setSpacing(6);
- SizeGroupLayout->setMargin(11);
+ myTabBox->addTab( mySegmentationCursorBox, tr( "SEGMENTATION_CURSOR_TAB" ) );
- // Geometry Size
- mySizeLabel = new QLabel( tr( "SIZE" ), SizeGroup );
- mySizeSpinBox = new QtxDblSpinBox( 0, 100, 1, SizeGroup );
- mySizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- SizeGroupLayout->addWidget( mySizeLabel, 0, 0 );
- SizeGroupLayout->addWidget( mySizeSpinBox, 0, 1 );
+ // Gauss points pane
+ myGaussPointsBox = new QVBox( this );
+ myGaussPointsBox->setMargin(11);
+ myGaussPointsBox->setSpacing(6);
- // Color
- QGroupBox* ColorGroup = new QGroupBox ( tr( "COLOR_TITLE" ), myOutsideCursorBox, "ColorGroup" );
- ColorGroup->setColumnLayout(0, Qt::Vertical );
- ColorGroup->layout()->setSpacing( 0 );
- ColorGroup->layout()->setMargin( 0 );
+ // Inside Gauss points
+ QGroupBox* anInsideGroup = new QGroupBox( tr( "INSIDE_GAUSS_POINTS" ), myGaussPointsBox );
+ anInsideGroup->setColumnLayout( 0, Qt::Vertical );
+ anInsideGroup->layout()->setSpacing( 0 );
+ anInsideGroup->layout()->setMargin( 0 );
- QGridLayout* ColorGroupLayout = new QGridLayout (ColorGroup->layout());
- ColorGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
- ColorGroupLayout->setSpacing(6);
- ColorGroupLayout->setMargin(11);
+ QGridLayout* anInsideGroupLayout = new QGridLayout( anInsideGroup->layout() );
+ anInsideGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ anInsideGroupLayout->setSpacing(6);
+ anInsideGroupLayout->setMargin(11);
- myColorLabel = new QLabel( tr( "COLOR" ), ColorGroup );
- myColorButton = new QPushButton( ColorGroup );
- myColorButton->setPaletteBackgroundColor( Qt::blue );
- myColorButton->setPaletteForegroundColor( Qt::blue );
+ // Primitive
+ myInsidePrimitiveBox = new VVTK_PrimitiveBox( anInsideGroup );
+
+ // Size
+ myInsideSizeBox = new VVTK_SizeBox( anInsideGroup );
+ myInsideSizeBox->setType( VVTK_SizeBox::Results );
- ColorGroupLayout->addWidget( myColorLabel, 0, 0 );
- ColorGroupLayout->addWidget( myColorButton, 0, 1 );
+ anInsideGroupLayout->addWidget( myInsidePrimitiveBox, 0, 0 );
+ anInsideGroupLayout->addWidget( myInsideSizeBox, 1, 0 );
- connect( myColorButton, SIGNAL( clicked() ), this, SLOT( onColorButtonPressed() ) );
+ // Outside Gauss points
+ QGroupBox* anOutsideGroup = new QGroupBox( tr( "OUTSIDE_GAUSS_POINTS" ), myGaussPointsBox );
+ anOutsideGroup->setColumnLayout( 0, Qt::Vertical );
+ anOutsideGroup->layout()->setSpacing( 0 );
+ anOutsideGroup->layout()->setMargin( 0 );
+ QGridLayout* anOutsideGroupLayout = new QGridLayout( anOutsideGroup->layout() );
+ anOutsideGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ anOutsideGroupLayout->setSpacing(6);
+ anOutsideGroupLayout->setMargin(11);
+
+ // Primitive
+ myOutsidePrimitiveBox = new VVTK_PrimitiveBox( anOutsideGroup );
+
+ // Size
+ myOutsideSizeBox = new VVTK_SizeBox( anOutsideGroup );
+ myOutsideSizeBox->setType( VVTK_SizeBox::Outside );
- myTabBox->addTab( myOutsideCursorBox, tr("OUTSIDE_CURSOR_TAB") );
- myTabBox->showPage( myOutsideCursorBox );
+ anOutsideGroupLayout->addWidget( myOutsidePrimitiveBox, 0, 0 );
+ anOutsideGroupLayout->addWidget( myOutsideSizeBox, 1, 0 );
+ myTabBox->addTab( myGaussPointsBox, tr( "GAUSS_POINTS_TAB" ) );
+ myTabBox->showPage( myGaussPointsBox );
// Common buttons ===========================================================
{
}
-void VVTK_SegmentationCursorDlg::AddActor( VISU_GaussPtsAct1* theActor )
-{
- theActor->SetOutsideCursorSettings( myOutsideCursorSettings.GetPointer() );
-}
-
-void VVTK_SegmentationCursorDlg::RemoveActor( VISU_GaussPtsAct1* theActor )
-{
- theActor->SetOutsideCursorSettings( NULL );
-}
-
void VVTK_SegmentationCursorDlg::SetWidget( VISU_ImplicitFunctionWidget* theWidget )
{
myWidget = theWidget;
void VVTK_SegmentationCursorDlg::UpdateSegmentation()
{
- float origin[3];
- myWidget->GetOrigin( origin );
- myXOriginSpinBox->setValue( origin[0] );
- myYOriginSpinBox->setValue( origin[1] );
- myZOriginSpinBox->setValue( origin[2] );
-
- float normal[3];
- myWidget->GetNormal( normal );
- myDXDirectionSpinBox->setValue( normal[0] );
- myDYDirectionSpinBox->setValue( normal[1] );
- myDZDirectionSpinBox->setValue( normal[2] );
-
- myDepthSpinBox->setValue( myWidget->Distance() );
+ if( myIsPlaneSegmentation )
+ {
+ myDirectionGroup->show();
+ myDepthGroup->show();
+ myRadiusGroup->hide();
+
+ float origin[3];
+ myWidget->GetOrigin( origin );
+ myXOriginSpinBox->setValue( origin[0] );
+ myYOriginSpinBox->setValue( origin[1] );
+ myZOriginSpinBox->setValue( origin[2] );
+
+ float normal[3];
+ myWidget->GetNormal( normal );
+ myDXDirectionSpinBox->setValue( normal[0] );
+ myDYDirectionSpinBox->setValue( normal[1] );
+ myDZDirectionSpinBox->setValue( normal[2] );
+
+ myDepthSpinBox->setValue( myWidget->Distance() );
+ }
+ else
+ {
+ myDirectionGroup->hide();
+ myDepthGroup->hide();
+ myRadiusGroup->show();
+ }
}
-void VVTK_SegmentationCursorDlg::onBrowseMainTexture()
+void VVTK_SegmentationCursorDlg::UpdateInsideGaussPoints()
{
- QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/";
- QString aFileName = QFileDialog::getOpenFileName( aRootDir, "Bitmap (*.bmp *.jpg *.png)", this );
+ int aPrimitiveType = VVTK_PrimitiveBox::PointSprite;
+ float aClamp = 200.0;
+ QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp";
+ QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp";
+ float anAlphaThreshold = 0.1;
+ int aMinSize = 3;
+ int aMaxSize = 33;
+ float aMagnification = 100.0;
+ float anIncrement = 2.0;
+
+ if( !myInsideCursorSettings->GetInitial() )
+ {
+ myInsidePrimitiveBox->setPrimitiveType( myInsideCursorSettings->GetPrimitiveType() );
+ myInsidePrimitiveBox->setClamp( myInsideCursorSettings->GetClamp() );
+ myInsidePrimitiveBox->setMainTexture( myInsideMainTexture );
+ myInsidePrimitiveBox->setAlphaTexture( myInsideAlphaTexture );
+ myInsidePrimitiveBox->setAlphaThreshold( myInsideCursorSettings->GetAlphaThreshold() );
+
+ myInsideSizeBox->setMinSize( myInsideCursorSettings->GetMinSize() );
+ myInsideSizeBox->setMaxSize( myInsideCursorSettings->GetMaxSize() );
+ myInsideSizeBox->setMagnification( myInsideCursorSettings->GetMagnification() );
+ myInsideSizeBox->setIncrement( myInsideCursorSettings->GetIncrement() );
- if( aFileName.isNull() )
return;
+ }
- myMainTexture = aFileName;
- myMainTextureLineEdit->setText( aFileName.section( '/', -1 ) );
-}
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-void VVTK_SegmentationCursorDlg::onBrowseAlphaTexture()
-{
- QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/";
- QString aFileName = QFileDialog::getOpenFileName( aRootDir, "Bitmap (*.bmp *.jpg *.png)", this );
+ aPrimitiveType = aResourceMgr->integerValue( "VISU", "inside_point_sprite_primitive_type", aPrimitiveType );
+ myInsidePrimitiveBox->setPrimitiveType( aPrimitiveType );
- if( aFileName.isNull() )
- return;
+ aClamp = aResourceMgr->doubleValue( "VISU", "inside_point_sprite_clamp", aClamp );
+ myInsidePrimitiveBox->setClamp( aClamp );
- myAlphaTexture = aFileName;
- myAlphaTextureLineEdit->setText( aFileName.section( '/', -1 ) );
-}
+ aMainTexture = aResourceMgr->stringValue( "VISU", "inside_point_sprite_main_texture", aMainTexture );
+ myInsidePrimitiveBox->setMainTexture( aMainTexture );
-void VVTK_SegmentationCursorDlg::onColorButtonPressed()
-{
- QColor aColor = QColorDialog::getColor( myColorButton->paletteBackgroundColor(), this );
- if( aColor.isValid() )
- myColorButton->setPaletteBackgroundColor( aColor );
+ anAlphaTexture = aResourceMgr->stringValue( "VISU", "inside_point_sprite_alpha_texture", anAlphaTexture );
+ myInsidePrimitiveBox->setAlphaTexture( anAlphaTexture );
+
+ anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "inside_point_sprite_alpha_threshold", anAlphaThreshold );
+ myInsidePrimitiveBox->setAlphaThreshold( anAlphaThreshold );
+
+ aMinSize = aResourceMgr->integerValue( "VISU", "inside_point_sprite_min_size", aMinSize );
+ myInsideSizeBox->setMinSize( aMinSize );
+
+ aMaxSize = aResourceMgr->integerValue( "VISU", "inside_point_sprite_max_size", aMaxSize );
+ myInsideSizeBox->setMaxSize( aMaxSize );
+
+ aMagnification = aResourceMgr->doubleValue( "VISU", "inside_point_sprite_magnification", aMagnification );
+ myInsideSizeBox->setMagnification( aMagnification );
+
+ anIncrement = aResourceMgr->doubleValue( "VISU", "inside_point_sprite_increment", anIncrement );
+ myInsideSizeBox->setIncrement( anIncrement );
+
+ ApplyInsideGaussPoints();
}
-void VVTK_SegmentationCursorDlg::UpdateOutsideCursor()
+void VVTK_SegmentationCursorDlg::UpdateOutsideGaussPoints()
{
+ int aPrimitiveType = VVTK_PrimitiveBox::PointSprite;
float aClamp = 200.0;
QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp";
QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp";
float anAlphaThreshold = 0.1;
int aSize = 25;
+ bool aUniform = false;
QColor aColor = Qt::blue;
if( !myOutsideCursorSettings->GetInitial() )
{
- myClampSpinBox->setValue( myOutsideCursorSettings->GetClamp() );
- myMainTextureLineEdit->setText( myMainTexture.section( '/', -1 ) );
- myAlphaTextureLineEdit->setText( myAlphaTexture.section( '/', -1 ) );
- myAlphaThresholdSpinBox->setValue( myOutsideCursorSettings->GetAlphaThreshold() );
- mySizeSpinBox->setValue( myOutsideCursorSettings->GetSize() );
+ myOutsidePrimitiveBox->setPrimitiveType( myOutsideCursorSettings->GetPrimitiveType() );
+ myOutsidePrimitiveBox->setClamp( myOutsideCursorSettings->GetClamp() );
+ myOutsidePrimitiveBox->setMainTexture( myOutsideMainTexture );
+ myOutsidePrimitiveBox->setAlphaTexture( myOutsideAlphaTexture );
+ myOutsidePrimitiveBox->setAlphaThreshold( myOutsideCursorSettings->GetAlphaThreshold() );
+
+ myOutsideSizeBox->setOutsideSize( myOutsideCursorSettings->GetSize() );
+ myOutsideSizeBox->setUniform( myOutsideCursorSettings->GetUniform() );
float* aColor = myOutsideCursorSettings->GetColor();
- myColorButton->setPaletteBackgroundColor( QColor( ( int )( aColor[0] * 255.0 ),
- ( int )( aColor[1] * 255.0 ),
- ( int )( aColor[2] * 255.0 ) ) );
+ myOutsideSizeBox->setColor( QColor( ( int )( aColor[0] * 255.0 ),
+ ( int )( aColor[1] * 255.0 ),
+ ( int )( aColor[2] * 255.0 ) ) );
return;
}
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ aPrimitiveType = aResourceMgr->integerValue( "VISU", "outside_point_sprite_primitive_type", aPrimitiveType );
+ myOutsidePrimitiveBox->setPrimitiveType( aPrimitiveType );
+
aClamp = aResourceMgr->doubleValue( "VISU", "outside_point_sprite_clamp", aClamp );
- myClampSpinBox->setValue( aClamp );
+ myOutsidePrimitiveBox->setClamp( aClamp );
- myMainTexture = aResourceMgr->stringValue( "VISU", "outside_point_sprite_main_texture", aMainTexture );
- myMainTextureLineEdit->setText( myMainTexture.section( '/', -1 ) );
+ aMainTexture = aResourceMgr->stringValue( "VISU", "outside_point_sprite_main_texture", aMainTexture );
+ myOutsidePrimitiveBox->setMainTexture( aMainTexture );
- myAlphaTexture = aResourceMgr->stringValue( "VISU", "outside_point_sprite_alpha_texture", anAlphaTexture );
- myAlphaTextureLineEdit->setText( myAlphaTexture.section( '/', -1 ) );
+ anAlphaTexture = aResourceMgr->stringValue( "VISU", "outside_point_sprite_alpha_texture", anAlphaTexture );
+ myOutsidePrimitiveBox->setAlphaTexture( anAlphaTexture );
anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "outside_point_sprite_alpha_threshold", anAlphaThreshold );
- myAlphaThresholdSpinBox->setValue( anAlphaThreshold );
+ myOutsidePrimitiveBox->setAlphaThreshold( anAlphaThreshold );
aSize = aResourceMgr->integerValue( "VISU", "outside_point_sprite_size", aSize );
- mySizeSpinBox->setValue( aSize );
+ myOutsideSizeBox->setOutsideSize( aSize );
+
+ aUniform = aResourceMgr->booleanValue( "VISU", "outside_point_sprite_uniform", aUniform );
+ myOutsideSizeBox->setUniform( aUniform );
aColor = aResourceMgr->colorValue( "VISU", "outside_point_sprite_color", aColor );
- myColorButton->setPaletteBackgroundColor( aColor );
+ myOutsideSizeBox->setColor( aColor );
- ApplyOutsideCursor();
+ ApplyOutsideGaussPoints();
+}
+
+VISU_InsideCursorSettings* VVTK_SegmentationCursorDlg::GetInsideCursorSettings()
+{
+ return myInsideCursorSettings.GetPointer();
}
VISU_OutsideCursorSettings* VVTK_SegmentationCursorDlg::GetOutsideCursorSettings()
return myOutsideCursorSettings.GetPointer();
}
-vtkImageData* VVTK_SegmentationCursorDlg::MakeImageData( const QString& theMainTexture,
+vtkImageData* VVTK_SegmentationCursorDlg::MakeImageData( bool theInside,
+ const QString& theMainTexture,
const QString& theAlphaTexture )
{
- //bool updateMainTexture = myMainTexture != theMainTexture;
- //bool updateAlphaTexture = myAlphaTexture != theAlphaTexture;
- //if( !updateMainTexture && !updateAlphaTexture )
- // return 0;
+ if( theInside )
+ {
+ bool updateMainTexture = myInsideMainTexture != theMainTexture;
+ bool updateAlphaTexture = myInsideAlphaTexture != theAlphaTexture;
+ if( !updateMainTexture && !updateAlphaTexture )
+ return 0;
+
+ myInsideMainTexture = theMainTexture;
+ myInsideAlphaTexture = theAlphaTexture;
+ }
+ else
+ {
+ bool updateMainTexture = myOutsideMainTexture != theMainTexture;
+ bool updateAlphaTexture = myOutsideAlphaTexture != theAlphaTexture;
+ if( !updateMainTexture && !updateAlphaTexture )
+ return 0;
- //myMainTexture = theMainTexture;
- //myAlphaTexture = theAlphaTexture;
+ myOutsideMainTexture = theMainTexture;
+ myOutsideAlphaTexture = theAlphaTexture;
+ }
QString mainTextureFormat = theMainTexture.section( '.', -1 );
QString mainTextureVTI = theMainTexture.section( '.', 0, -2 ) + ".vti";
if( myTabBox->currentPage() == mySegmentationCursorBox )
ApplySegmentationCursor();
else
- ApplyOutsideCursor();
+ {
+ ApplyInsideGaussPoints();
+ ApplyOutsideGaussPoints();
+ }
}
void VVTK_SegmentationCursorDlg::ApplySegmentationCursor()
{
- float origin[3];
- origin[0] = myXOriginSpinBox->value();
- origin[1] = myYOriginSpinBox->value();
- origin[2] = myZOriginSpinBox->value();
- myWidget->SetOrigin( origin );
-
- float normal[3];
- normal[0] = myDXDirectionSpinBox->value();
- normal[1] = myDYDirectionSpinBox->value();
- normal[2] = myDZDirectionSpinBox->value();
- myWidget->SetNormal( normal );
-
- myWidget->SetDistance( myDepthSpinBox->value() );
-
- myWidget->InvokeEvent(vtkCommand::EndInteractionEvent,NULL);
- myWidget->GetInteractor()->Render();
+ if( myIsPlaneSegmentation )
+ {
+ float origin[3];
+ origin[0] = myXOriginSpinBox->value();
+ origin[1] = myYOriginSpinBox->value();
+ origin[2] = myZOriginSpinBox->value();
+ myWidget->SetOrigin( origin );
+
+ float normal[3];
+ normal[0] = myDXDirectionSpinBox->value();
+ normal[1] = myDYDirectionSpinBox->value();
+ normal[2] = myDZDirectionSpinBox->value();
+ myWidget->SetNormal( normal );
+
+ myWidget->SetDistance( myDepthSpinBox->value() );
+
+ myWidget->InvokeEvent(vtkCommand::EndInteractionEvent,NULL);
+ myWidget->GetInteractor()->Render();
+ }
+ else
+ {
+
+ }
}
-void VVTK_SegmentationCursorDlg::ApplyOutsideCursor()
+void VVTK_SegmentationCursorDlg::ApplyInsideGaussPoints()
{
- vtkImageData* aTexture = this->MakeImageData( myMainTexture, myAlphaTexture );
+ QString anInsideMainTexture = myInsidePrimitiveBox->getMainTexture();
+ QString anInsideAlphaTexture = myInsidePrimitiveBox->getAlphaTexture();
+ vtkImageData* aTexture = this->MakeImageData( true, anInsideMainTexture, anInsideAlphaTexture );
+
+ if( aTexture )
+ myInsideCursorSettings->SetTexture( aTexture );
+
+ myInsideCursorSettings->SetInitial( false );
+ myInsideCursorSettings->SetPrimitiveType( myInsidePrimitiveBox->getPrimitiveType() );
+ myInsideCursorSettings->SetClamp( myInsidePrimitiveBox->getClamp() );
+ myInsideCursorSettings->SetAlphaThreshold( myInsidePrimitiveBox->getAlphaThreshold() );
+
+ myInsideCursorSettings->SetMinSize( myInsideSizeBox->getMinSize() );
+ myInsideCursorSettings->SetMaxSize( myInsideSizeBox->getMaxSize() );
+ myInsideCursorSettings->SetMagnification( myInsideSizeBox->getMagnification() );
+ myInsideCursorSettings->SetIncrement( myInsideSizeBox->getIncrement() );
+
+ myInsideCursorSettings->InvokeEvent(VISU::UpdateInsideSettingsEvent,NULL);
+}
+
+void VVTK_SegmentationCursorDlg::ApplyOutsideGaussPoints()
+{
+ QString anOutsideMainTexture = myOutsidePrimitiveBox->getMainTexture();
+ QString anOutsideAlphaTexture = myOutsidePrimitiveBox->getAlphaTexture();
+ vtkImageData* aTexture = this->MakeImageData( false, anOutsideMainTexture, anOutsideAlphaTexture );
+
+ if( aTexture )
+ myOutsideCursorSettings->SetTexture( aTexture );
myOutsideCursorSettings->SetInitial( false );
- myOutsideCursorSettings->SetClamp( myClampSpinBox->value() );
- myOutsideCursorSettings->SetTexture( aTexture );
- myOutsideCursorSettings->SetAlphaThreshold( myAlphaThresholdSpinBox->value() );
- myOutsideCursorSettings->SetSize( mySizeSpinBox->value() );
+ myOutsideCursorSettings->SetPrimitiveType( myOutsidePrimitiveBox->getPrimitiveType() );
+ myOutsideCursorSettings->SetClamp( myOutsidePrimitiveBox->getClamp() );
+ myOutsideCursorSettings->SetAlphaThreshold( myOutsidePrimitiveBox->getAlphaThreshold() );
+
+ myOutsideCursorSettings->SetSize( myOutsideSizeBox->getOutsideSize() );
+ myOutsideCursorSettings->SetUniform( myOutsideSizeBox->getUniform() );
- QColor aButtonColor = myColorButton->paletteBackgroundColor();
+ QColor aButtonColor = myOutsideSizeBox->getColor();
float aColor[3];
aColor[0] = aButtonColor.red() / 255.0;
aColor[1] = aButtonColor.green() / 255.0;
void VVTK_SegmentationCursorDlg::onClickClose()
{
- myAction->setOn( false );
+ myPlaneAction->setOn( false );
+ mySphereAction->setOn( false );
reject();
}
void VVTK_SegmentationCursorDlg::done( int r )
{
- myAction->setOn( false );
+ myPlaneAction->setOn( false );
+ mySphereAction->setOn( false );
QDialog::done( r );
}
class QPushButton;
class QRadioButton;
class QTabWidget;
+class QGroupBox;
class QVBox;
class QtxAction;
class QtxDblSpinBox;
class VISU_GaussPtsAct1;
+class VISU_InsideCursorSettings;
class VISU_OutsideCursorSettings;
class VISU_ImplicitFunctionWidget;
+class VVTK_PrimitiveBox;
+class VVTK_SizeBox;
+
class VVTK_SegmentationCursorDlg : public QDialog
{
Q_OBJECT
VVTK_SegmentationCursorDlg( QWidget* parent = 0, const char* name = 0 );
~VVTK_SegmentationCursorDlg();
- void AddActor( VISU_GaussPtsAct1* );
- void RemoveActor( VISU_GaussPtsAct1* );
-
void SetWidget( VISU_ImplicitFunctionWidget* );
- void SetAction( QtxAction* theAction ) { myAction = theAction; }
+ void SetPlaneAction( QtxAction* theAction ) { myPlaneAction = theAction; }
+ void SetSphereAction( QtxAction* theAction ) { mySphereAction = theAction; }
- void UpdateSegmentation();
+ bool GetIsPlaneSegmentation() const { return myIsPlaneSegmentation; }
+ void SetIsPlaneSegmentation( bool on ) { myIsPlaneSegmentation = on; }
- void UpdateOutsideCursor();
+ void UpdateSegmentation();
+ void UpdateInsideGaussPoints();
+ void UpdateOutsideGaussPoints();
+ VISU_InsideCursorSettings* GetInsideCursorSettings();
VISU_OutsideCursorSettings* GetOutsideCursorSettings();
protected:
void ApplySegmentationCursor();
- void ApplyOutsideCursor();
+ void ApplyInsideGaussPoints();
+ void ApplyOutsideGaussPoints();
- vtkImageData* MakeImageData( const QString& theMainTexture,
+ vtkImageData* MakeImageData( bool theInside,
+ const QString& theMainTexture,
const QString& theAlphaTexture );
private:
void onClickApply();
void onClickClose();
- void onBrowseMainTexture();
- void onBrowseAlphaTexture();
- void onColorButtonPressed();
-
private:
QTabWidget* myTabBox;
// Segmentation cursor
QVBox* mySegmentationCursorBox;
+ QGroupBox* myOriginGroup;
QtxDblSpinBox* myXOriginSpinBox;
QtxDblSpinBox* myYOriginSpinBox;
QtxDblSpinBox* myZOriginSpinBox;
+ QGroupBox* myDirectionGroup;
QtxDblSpinBox* myDXDirectionSpinBox;
QtxDblSpinBox* myDYDirectionSpinBox;
QtxDblSpinBox* myDZDirectionSpinBox;
+ QGroupBox* myDepthGroup;
QtxDblSpinBox* myDepthSpinBox;
+ QGroupBox* myRadiusGroup;
+ QtxDblSpinBox* myRadiusSpinBox;
+ QtxDblSpinBox* myRatioSpinBox;
+
+ bool myIsPlaneSegmentation;
+
float myPriority;
vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
VISU_ImplicitFunctionWidget* myWidget;
- QtxAction* myAction;
+ QtxAction* myPlaneAction;
+ QtxAction* mySphereAction;
- // Outside cursor
- QVBox* myOutsideCursorBox;
+ // Gauss Points
+ QVBox* myGaussPointsBox;
- QtxDblSpinBox* myClampSpinBox;
+ VVTK_PrimitiveBox* myInsidePrimitiveBox;
+ VVTK_SizeBox* myInsideSizeBox;
- QLineEdit* myMainTextureLineEdit;
- QLineEdit* myAlphaTextureLineEdit;
- QtxDblSpinBox* myAlphaThresholdSpinBox;
+ QString myInsideMainTexture;
+ QString myInsideAlphaTexture;
- QLabel* mySizeLabel;
- QtxDblSpinBox* mySizeSpinBox;
+ vtkSmartPointer<VISU_InsideCursorSettings> myInsideCursorSettings;
- QLabel* myColorLabel;
- QPushButton* myColorButton;
+ VVTK_PrimitiveBox* myOutsidePrimitiveBox;
+ VVTK_SizeBox* myOutsideSizeBox;
- QString myMainTexture;
- QString myAlphaTexture;
+ QString myOutsideMainTexture;
+ QString myOutsideAlphaTexture;
vtkSmartPointer<VISU_OutsideCursorSettings> myOutsideCursorSettings;
};
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 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 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
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : VVTK_SizeBox.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+
+#include "VVTK_SizeBox.h"
+
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+
+#include "QtxDblSpinBox.h"
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qcheckbox.h>
+#include <qgroupbox.h>
+#include <qbuttongroup.h>
+#include <qradiobutton.h>
+#include <qpushbutton.h>
+#include <qcolordialog.h>
+
+using namespace std;
+
+VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) :
+ QVBox( parent )
+{
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+
+ layout()->setSpacing( 0 );
+ layout()->setMargin( 0 );
+
+ // Size
+ QGroupBox* SizeGroup = new QGroupBox ( tr( "SIZE_TITLE" ), this, "SizeGroup" );
+ SizeGroup->setColumnLayout(0, Qt::Vertical );
+ SizeGroup->layout()->setSpacing( 0 );
+ SizeGroup->layout()->setMargin( 0 );
+
+ QGridLayout* SizeGroupLayout = new QGridLayout (SizeGroup->layout());
+ SizeGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ SizeGroupLayout->setSpacing(6);
+ SizeGroupLayout->setMargin(11);
+
+ // Outside Size
+ myOutsideSizeLabel = new QLabel( tr( "OUTSIDE_SIZE" ), SizeGroup );
+ myOutsideSizeSpinBox = new QtxDblSpinBox( 0, 100, 1, SizeGroup );
+ myOutsideSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myOutsideSizeLabel, 0, 0 );
+ SizeGroupLayout->addWidget( myOutsideSizeSpinBox, 0, 1 );
+
+ // Geometry Size
+ myGeomSizeLabel = new QLabel( tr( "GEOM_SIZE" ), SizeGroup );
+ myGeomSizeSpinBox = new QtxDblSpinBox( 0, 100, 1, SizeGroup );
+ myGeomSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myGeomSizeLabel, 0, 0 );
+ SizeGroupLayout->addWidget( myGeomSizeSpinBox, 0, 1 );
+
+ // Min Size
+ myMinSizeLabel = new QLabel( tr( "MIN_SIZE" ), SizeGroup );
+ myMinSizeSpinBox = new QtxDblSpinBox( 0, 100, 1, SizeGroup );
+ myMinSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myMinSizeLabel, 1, 0 );
+ SizeGroupLayout->addWidget( myMinSizeSpinBox, 1, 1 );
+
+ // Max Size
+ myMaxSizeLabel = new QLabel( tr( "MAX_SIZE" ), SizeGroup );
+ myMaxSizeSpinBox = new QtxDblSpinBox( 0, 100, 1, SizeGroup );
+ myMaxSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myMaxSizeLabel, 1, 2 );
+ SizeGroupLayout->addWidget( myMaxSizeSpinBox, 1, 3 );
+
+ // Magnification
+ myMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), SizeGroup );
+ myMagnificationSpinBox = new QtxDblSpinBox( 10, 1000, 10, SizeGroup );
+ myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myMagnificationLabel, 2, 0 );
+ SizeGroupLayout->addWidget( myMagnificationSpinBox, 2, 1 );
+
+ // Increment
+ myIncrementLabel = new QLabel( tr( "INCREMENT" ), SizeGroup );
+ myIncrementSpinBox = new QtxDblSpinBox( 0.01, 10, 0.1, SizeGroup );
+ myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myIncrementLabel, 2, 2 );
+ SizeGroupLayout->addWidget( myIncrementSpinBox, 2, 3 );
+
+
+ // Color
+ myColorGroup = new QGroupBox ( tr( "COLOR_TITLE" ), this, "ColorGroup" );
+ myColorGroup->setColumnLayout(0, Qt::Vertical );
+ myColorGroup->layout()->setSpacing( 0 );
+ myColorGroup->layout()->setMargin( 0 );
+
+ QGridLayout* ColorGroupLayout = new QGridLayout (myColorGroup->layout());
+ ColorGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
+ ColorGroupLayout->setSpacing(6);
+ ColorGroupLayout->setMargin(11);
+
+ myUniformCheckBox = new QCheckBox( tr( "UNIFORM_COLOR" ), myColorGroup );
+
+ myColorLabel = new QLabel( tr( "COLOR" ), myColorGroup );
+ myColorButton = new QPushButton( myColorGroup );
+
+ ColorGroupLayout->addWidget( myUniformCheckBox, 0, 0 );
+ ColorGroupLayout->addWidget( myColorLabel, 0, 1 );
+ ColorGroupLayout->addWidget( myColorButton, 0, 2 );
+
+ connect( myUniformCheckBox, SIGNAL( toggled( bool ) ), myColorButton, SLOT( setEnabled( bool ) ) );
+ connect( myColorButton, SIGNAL( clicked() ), this, SLOT( onColorButtonPressed() ) );
+
+ setType( VVTK_SizeBox::Results );
+}
+
+void VVTK_SizeBox::onToggleResults()
+{
+ myType = VVTK_SizeBox::Results;
+
+ myOutsideSizeLabel->hide();
+ myOutsideSizeSpinBox->hide();
+
+ myGeomSizeLabel->hide();
+ myGeomSizeSpinBox->hide();
+
+ myMinSizeLabel->show();
+ myMinSizeSpinBox->show();
+
+ myMaxSizeLabel->show();
+ myMaxSizeSpinBox->show();
+
+ myColorGroup->hide();
+}
+
+void VVTK_SizeBox::onToggleGeometry()
+{
+ myType = VVTK_SizeBox::Geometry;
+
+ myOutsideSizeLabel->hide();
+ myOutsideSizeSpinBox->hide();
+
+ myGeomSizeLabel->show();
+ myGeomSizeSpinBox->show();
+
+ myMinSizeLabel->hide();
+ myMinSizeSpinBox->hide();
+
+ myMaxSizeLabel->hide();
+ myMaxSizeSpinBox->hide();
+
+ myColorGroup->show();
+
+ myUniformCheckBox->hide();
+}
+
+void VVTK_SizeBox::onToggleOutside()
+{
+ myType = VVTK_SizeBox::Outside;
+
+ myOutsideSizeLabel->show();
+ myOutsideSizeSpinBox->show();
+
+ myGeomSizeLabel->hide();
+ myGeomSizeSpinBox->hide();
+
+ myMinSizeLabel->hide();
+ myMinSizeSpinBox->hide();
+
+ myMaxSizeLabel->hide();
+ myMaxSizeSpinBox->hide();
+
+ myMagnificationLabel->hide();
+ myMagnificationSpinBox->hide();
+
+ myIncrementLabel->hide();
+ myIncrementSpinBox->hide();
+
+ myColorGroup->show();
+
+ myUniformCheckBox->show();
+}
+
+void VVTK_SizeBox::setType( int theType )
+{
+ myType = theType;
+
+ switch( myType )
+ {
+ case VVTK_SizeBox::Results : onToggleResults(); break;
+ case VVTK_SizeBox::Geometry : onToggleGeometry(); break;
+ case VVTK_SizeBox::Outside : onToggleOutside(); break;
+ default : break;
+ }
+}
+
+float VVTK_SizeBox::getOutsideSize() const
+{
+ return myOutsideSizeSpinBox->value();
+}
+
+void VVTK_SizeBox::setOutsideSize( float theOutsideSize )
+{
+ myOutsideSizeSpinBox->setValue( theOutsideSize );
+}
+
+float VVTK_SizeBox::getGeomSize() const
+{
+ return myGeomSizeSpinBox->value();
+}
+
+void VVTK_SizeBox::setGeomSize( float theGeomSize )
+{
+ myGeomSizeSpinBox->setValue( theGeomSize );
+}
+
+float VVTK_SizeBox::getMinSize() const
+{
+ return myMinSizeSpinBox->value();
+}
+
+void VVTK_SizeBox::setMinSize( float theMinSize )
+{
+ myMinSizeSpinBox->setValue( theMinSize );
+}
+
+float VVTK_SizeBox::getMaxSize() const
+{
+ return myMaxSizeSpinBox->value();
+}
+
+void VVTK_SizeBox::setMaxSize( float theMaxSize )
+{
+ myMaxSizeSpinBox->setValue( theMaxSize );
+}
+
+float VVTK_SizeBox::getMagnification() const
+{
+ return myMagnificationSpinBox->value();
+}
+
+void VVTK_SizeBox::setMagnification( float theMagnification )
+{
+ myMagnificationSpinBox->setValue( theMagnification );
+}
+
+float VVTK_SizeBox::getIncrement() const
+{
+ return myIncrementSpinBox->value();
+}
+
+void VVTK_SizeBox::setIncrement( float theIncrement )
+{
+ myIncrementSpinBox->setValue( theIncrement );
+}
+
+bool VVTK_SizeBox::getUniform() const
+{
+ return myUniformCheckBox->isChecked();
+}
+
+void VVTK_SizeBox::setUniform( bool theUniform )
+{
+ myUniformCheckBox->setChecked( theUniform );
+ myColorButton->setEnabled( theUniform );
+}
+
+QColor VVTK_SizeBox::getColor() const
+{
+ return myColorButton->paletteBackgroundColor();
+}
+
+void VVTK_SizeBox::setColor( const QColor& theColor )
+{
+ myColorButton->setPaletteBackgroundColor( theColor );
+}
+
+void VVTK_SizeBox::onColorButtonPressed()
+{
+ QColor aColor = QColorDialog::getColor( myColorButton->paletteBackgroundColor(), this );
+ if( aColor.isValid() )
+ myColorButton->setPaletteBackgroundColor( aColor );
+}
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 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 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
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : VVTK_SizeBox.h
+// Author : Oleg UVAROV
+// Module : VISU
+
+#ifndef VVTK_SIZEBOX_H
+#define VVTK_SIZEBOX_H
+
+#include <qvbox.h>
+
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QCheckBox;
+class QGroupBox;
+
+class QtxDblSpinBox;
+
+class VVTK_SizeBox : public QVBox
+{
+ Q_OBJECT
+
+public:
+ enum { Results = 0, Geometry, Outside };
+
+public:
+ VVTK_SizeBox( QWidget* );
+ ~VVTK_SizeBox() {}
+
+public:
+ int getType() const { return myType; }
+ void setType( int );
+
+ float getOutsideSize() const;
+ void setOutsideSize( float );
+
+ float getGeomSize() const;
+ void setGeomSize( float );
+
+ float getMinSize() const;
+ void setMinSize( float );
+
+ float getMaxSize() const;
+ void setMaxSize( float );
+
+ float getMagnification() const;
+ void setMagnification( float );
+
+ float getIncrement() const;
+ void setIncrement( float );
+
+ bool getUniform() const;
+ void setUniform( bool );
+
+ QColor getColor() const;
+ void setColor( const QColor& );
+
+protected slots:
+ void onToggleResults();
+ void onToggleGeometry();
+ void onToggleOutside();
+
+ void onColorButtonPressed();
+
+private:
+ int myType;
+
+ QLabel* myOutsideSizeLabel;
+ QtxDblSpinBox* myOutsideSizeSpinBox;
+
+ QLabel* myGeomSizeLabel;
+ QtxDblSpinBox* myGeomSizeSpinBox;
+
+ QLabel* myMinSizeLabel;
+ QtxDblSpinBox* myMinSizeSpinBox;
+
+ QLabel* myMaxSizeLabel;
+ QtxDblSpinBox* myMaxSizeSpinBox;
+
+ QLabel* myMagnificationLabel;
+ QtxDblSpinBox* myMagnificationSpinBox;
+
+ QLabel* myIncrementLabel;
+ QtxDblSpinBox* myIncrementSpinBox;
+
+ QCheckBox* myUniformCheckBox;
+
+ QGroupBox* myColorGroup;
+ QLabel* myColorLabel;
+ QPushButton* myColorButton;
+};
+
+
+
+#endif
//aSplitter->setChildrenCollapsible(true);
VISU_ImplicitFunctionWidget* anImplicitFunctionWidget = NULL;
+ VISU_InsideCursorSettings* anInsideCursorSettings = NULL;
VISU_OutsideCursorSettings* anOutsideCursorSettings = NULL;
VISU_PickingSettings* aPickingSettings = NULL;
SVTK_Selector* aSelector = SVTK_Selector::New();
"VVTK_MainWindow",
aResourceMgr);
+ anInsideCursorSettings = myMainWindow1->GetInsideCursorSettings();
anOutsideCursorSettings = myMainWindow1->GetOutsideCursorSettings();
aPickingSettings = myMainWindow1->GetPickingSettings();
VVTK_Renderer1* aRenderer = VVTK_Renderer1::New();
aRenderer->Initialize(aDevice,aSelector);
anImplicitFunctionWidget = aRenderer->GetImplicitFunctionWidget();
+ aRenderer->SetInsideCursorSettings(anInsideCursorSettings);
aRenderer->SetOutsideCursorSettings(anOutsideCursorSettings);
aRenderer->SetPickingSettings(aPickingSettings);
VVTK_Renderer2* aRenderer = VVTK_Renderer2::New();
aRenderer->Initialize(aDevice,aSelector);
aRenderer->SetImplicitFunctionWidget(anImplicitFunctionWidget);
+ aRenderer->SetInsideCursorSettings(anInsideCursorSettings);
aRenderer->SetPickingSettings(aPickingSettings);
anIteractor->Initialize(aDevice,aRenderer,aSelector);