// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// VISU OBJECT : interactive object for VISU entities implementation
-// File :
-// Author :
+// File :
+// Author :
// Module : VISU
// $Header$
//
#include "VTKViewer_ShrinkFilter.h"
#include "VTKViewer_GeometryFilter.h"
#include "VISU_ActorFactory.h"
-
+
#include <stdexcept>
#include <sstream>
}
//----------------------------------------------------------------------------
-void
+void
VISU_Actor
::setIO(const Handle(SALOME_InteractiveObject)& theIO)
{
- Superclass::setIO(theIO);
- myName = theIO->getName();
+ Superclass::setIO(theIO);
+ myName = theIO->getName();
}
//----------------------------------------------------------------------------
-void
+void
VISU_Actor
::SetPrs3d(VISU::Prs3d_i* thePrs3d)
-{
+{
myPrs3d = thePrs3d;
}
-VISU::Prs3d_i*
+VISU::Prs3d_i*
VISU_Actor
::GetPrs3d()
-{
+{
return myPrs3d;
}
//----------------------------------------------------------------------------
void
VISU_Actor
-::SetPipeLine(VISU_PipeLine* thePipeLine)
+::SetPipeLine(VISU_PipeLine* thePipeLine)
{
myPipeLine = thePipeLine;
if ( thePipeLine ) {
if ( vtkMapper *aMapper = myPipeLine->GetMapper() ) {
if ( vtkDataSet *aDataSet = aMapper->GetInput() ) {
- SetShrinkable( thePipeLine->IsShrinkable() );
- SetMapperInput( aDataSet );
+ SetShrinkable( thePipeLine->IsShrinkable() );
+ SetMapperInput( aDataSet );
}
}
}
this->Modified();
}
-VISU_PipeLine*
+VISU_PipeLine*
VISU_Actor
-::GetPipeLine()
-{
+::GetPipeLine()
+{
return myPipeLine.GetPointer();
}
-VISU_PipeLine*
+VISU_PipeLine*
VISU_Actor
-::GetCurrentPL()
-{
+::GetCurrentPL()
+{
return GetPipeLine();
}
//----------------------------------------------------------------------------
void
VISU_Actor
-::SetRepresentation(int theMode)
-{
+::SetRepresentation(int theMode)
+{
Superclass::SetRepresentation(theMode);
if(myRepresentation == VTK_POINTS)
UnShrink();
VISU_Actor
::SetShrink()
{
- if(!myIsShrinkable)
+ if(!myIsShrinkable)
return;
if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
myShrinkFilter->SetInput(aDataSet);
VISU_Actor
::UnShrink()
{
- if(!myIsShrunk)
+ if(!myIsShrunk)
return;
if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
myPassFilter[1]->SetInput(aDataSet);
bool
VISU_Actor
-::IsShrunkable()
-{
+::IsShrunkable()
+{
return myIsShrinkable;
}
vtkFloatingPointType
VISU_Actor
::GetOpacity()
-{
+{
return GetProperty()->GetOpacity();
}
::RemoveFromRender(vtkRenderer* theRenderer)
{
theRenderer->RemoveActor(myAnnotationActor.GetPointer());
- Superclass::RemoveFromRender(theRenderer);
+ Superclass::RemoveFromRender(theRenderer);
myDestroySignal(this);
}
//----------------------------------------------------------------------------
-void
+void
VISU_Actor
::SetVTKMapping(bool theIsVTKMapping)
{
myIsVTKMapping = theIsVTKMapping;
}
-bool
+bool
VISU_Actor
::IsVTKMapping() const
{
}
//----------------------------------------------------------------------------
-vtkDataSet*
+vtkDataSet*
VISU_Actor
::GetInput()
{
return VISU::GetElemVTKID(GetMapper()->GetInput(), theID);
}
-vtkCell*
+vtkCell*
VISU_Actor
::GetElemCell(vtkIdType theObjID)
{
//----------------------------------------------------------------------------
bool
VISU_Actor
-::PreHighlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight)
+::PreHighlight(vtkInteractorStyle* theInteractorStyle,
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
{
bool aRet = Superclass::PreHighlight(theInteractorStyle,
- theSelectionEvent,
- theIsHighlight);
+ theSelectionEvent,
+ theIsHighlight);
#ifndef ENABLE_ANNOTATION
return aRet;
-#endif
+#endif
//
myAnnotationActor->SetVisibility(0);
if(theIsHighlight){
switch(mySelectionMode){
- case CellSelection:{
+ case CellSelection:{
vtkRenderer* aRenderer = theInteractorStyle->GetCurrentRenderer();
- myCellPicker->Pick(theSelectionEvent->myX,
- theSelectionEvent->myY,
- 0.0,
- aRenderer);
+ myCellPicker->Pick(theSelectionEvent->myX,
+ theSelectionEvent->myY,
+ 0.0,
+ aRenderer);
if(myCellPicker->GetActor() != this)
- return false;
-
+ return false;
+
vtkIdType aVTKId = myCellPicker->GetCellId();
if(aVTKId >= 0 && mySelector->IsValid(this,aVTKId,true) && hasIO()){
- vtkIdType anObjId = GetElemObjId(aVTKId);
- if(vtkCell* aCell = GetElemCell(anObjId)){
- vtkPoints* aPts = aCell->GetPoints();
- if(int aNbPts = aCell->GetNumberOfPoints()){
- vtkFloatingPointType aCoord[3] = {0.0, 0.0, 0.0};
- for(int i = 0; i < aNbPts; i++){
- vtkFloatingPointType *aPntCoord = aPts->GetPoint(i);
- aCoord[0] += aPntCoord[0];
- aCoord[1] += aPntCoord[1];
- aCoord[2] += aPntCoord[2];
- }
- // Display coordinates
- vtkFloatingPointType aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0};
- aRenderer->SetWorldPoint(aWorldCoord);
- aRenderer->WorldToDisplay();
- vtkFloatingPointType aSelectionPoint[3];
- aRenderer->GetDisplayPoint(aSelectionPoint);
- myAnnotationActor->SetPosition(aSelectionPoint);
- //
- // To prepare the annotation text
- std::ostringstream aStr;
- aStr<<"Cell ID: "<< anObjId;
- std::string aString = aStr.str();
- myAnnotationMapper->SetInput(aString.c_str());
-
- myAnnotationActor->SetVisibility(1);
- return true;
- }
- }
+ vtkIdType anObjId = GetElemObjId(aVTKId);
+ if(vtkCell* aCell = GetElemCell(anObjId)){
+ vtkPoints* aPts = aCell->GetPoints();
+ if(int aNbPts = aCell->GetNumberOfPoints()){
+ vtkFloatingPointType aCoord[3] = {0.0, 0.0, 0.0};
+ for(int i = 0; i < aNbPts; i++){
+ vtkFloatingPointType *aPntCoord = aPts->GetPoint(i);
+ aCoord[0] += aPntCoord[0];
+ aCoord[1] += aPntCoord[1];
+ aCoord[2] += aPntCoord[2];
+ }
+ // Display coordinates
+ vtkFloatingPointType aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ vtkFloatingPointType aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myAnnotationActor->SetPosition(aSelectionPoint);
+ //
+ // To prepare the annotation text
+ std::ostringstream aStr;
+ aStr<<"Cell ID: "<< anObjId;
+ std::string aString = aStr.str();
+ myAnnotationMapper->SetInput(aString.c_str());
+
+ myAnnotationActor->SetVisibility(1);
+ return true;
+ }
+ }
}
break;
}
- case NodeSelection:{
+ case NodeSelection:{
vtkRenderer* aRenderer = theInteractorStyle->GetCurrentRenderer();
- myPointPicker->Pick(theSelectionEvent->myX,
- theSelectionEvent->myY,
- 0.0,
- aRenderer);
-
+ myPointPicker->Pick(theSelectionEvent->myX,
+ theSelectionEvent->myY,
+ 0.0,
+ aRenderer);
+
if(myPointPicker->GetActor() != this)
- return false;
+ return false;
vtkIdType aVtkId = myPointPicker->GetPointId();
if(aVtkId >= 0 && mySelector->IsValid(this,aVtkId,true) && hasIO()){
- vtkIdType anObjId = GetNodeObjId( aVtkId );
- if(vtkFloatingPointType* aCoord = GetNodeCoord(anObjId)){
- // Display coordinates
- vtkFloatingPointType aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
- aRenderer->SetWorldPoint(aWorldCoord);
- aRenderer->WorldToDisplay();
- vtkFloatingPointType aSelectionPoint[3];
- aRenderer->GetDisplayPoint(aSelectionPoint);
- myAnnotationActor->SetPosition(aSelectionPoint);
- //
- // To prepare the annotation text
- std::ostringstream aStr;
- aStr<<"Node ID: "<< anObjId;
- std::string aString = aStr.str();
- myAnnotationMapper->SetInput(aString.c_str());
-
- myAnnotationActor->SetVisibility(1);
- return true;
- }
+ vtkIdType anObjId = GetNodeObjId( aVtkId );
+ if(vtkFloatingPointType* aCoord = GetNodeCoord(anObjId)){
+ // Display coordinates
+ vtkFloatingPointType aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ vtkFloatingPointType aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myAnnotationActor->SetPosition(aSelectionPoint);
+ //
+ // To prepare the annotation text
+ std::ostringstream aStr;
+ aStr<<"Node ID: "<< anObjId;
+ std::string aString = aStr.str();
+ myAnnotationMapper->SetInput(aString.c_str());
+
+ myAnnotationActor->SetVisibility(1);
+ return true;
+ }
}
break;
}
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Extractor.cxx
// Module : VISU
-//
+
#include "VISU_Extractor.hxx"
#include "VISU_PipeLineUtils.hxx"
#include "VISU_ConvertorUtils.hxx"
+#include "SUIT_Session.h"
+#include "SUIT_ResourceMgr.h"
+
#include <sstream>
#include <vtkObjectFactory.h>
#include <vtkInformationVector.h>
-
//----------------------------------------------------------------------------
vtkStandardNewMacro(VISU_Extractor);
return myScalarMode;
}
+//----------------------------------------------------------------------------
+vtkFloatingPointType CutValue (vtkFloatingPointType theValue, int theDecimals)
+{
+ vtkFloatingPointType v = theValue;
+ vtkFloatingPointType aDegree = 0.0;
+ if (abs((long long)v) > 1)
+ aDegree = (long long)log10(abs((long long)v)) + 1;
+ aDegree = theDecimals - aDegree;
+ //printf("$$$ 1 v = %.20g , aDegree = %lld \n", v, (long long)aDegree);
+
+ aDegree = pow(10, aDegree);
+ v = ((vtkFloatingPointType)((long long)(v * aDegree))) / aDegree;
+ //printf("$$$ 2 v = %.20g , aDegree = %lld \n", v, (long long)aDegree);
+
+ return v;
+}
//----------------------------------------------------------------------------
-template<typename TValueType>
+template<typename TValueType>
void
Module2Scalars(vtkDataArray *theInputDataArray,
- TValueType* theOutputPtr,
- vtkIdType theNbOfTuples)
+ TValueType* theOutputPtr,
+ vtkIdType theNbOfTuples)
{
vtkIdType aNbComp = theInputDataArray->GetNumberOfComponents();
std::vector<vtkFloatingPointType> anArray(aNbComp < 3? 3: aNbComp);
for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
theInputDataArray->GetTuple(aTupleId, &anArray[0]);
vtkFloatingPointType aVector[3] = {anArray[0], anArray[1], anArray[2]};
- vtkFloatingPointType aScalar = sqrt(aVector[0]*aVector[0] +
- aVector[1]*aVector[1] +
- aVector[2]*aVector[2]);
+ vtkFloatingPointType aScalar = sqrt(aVector[0]*aVector[0] +
+ aVector[1]*aVector[1] +
+ aVector[2]*aVector[2]);
*theOutputPtr = TValueType(aScalar);
theOutputPtr++;
}
//----------------------------------------------------------------------------
-template<typename TValueType>
+template<typename TValueType>
void
Component2Scalars(vtkDataArray *theInputDataArray,
- TValueType* theInputPtr,
- TValueType* theOutputPtr,
- vtkIdType theNbOfTuples,
- vtkIdType theComponentId)
+ TValueType* theInputPtr,
+ TValueType* theOutputPtr,
+ vtkIdType theNbOfTuples,
+ vtkIdType theComponentId)
{
vtkIdType aNbComp = theInputDataArray->GetNumberOfComponents();
for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
}
}
+//----------------------------------------------------------------------------
+template<typename TValueType>
+void
+CutScalarsTempl(TValueType* theDataPtr,
+ vtkIdType theNbOfTuples,
+ int theDecimals)
+{
+ for (vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) {
+ *theDataPtr = TValueType(CutValue(*theDataPtr, theDecimals));
+ theDataPtr++;
+ }
+}
//----------------------------------------------------------------------------
template<typename TDataSetAttributesType> void
-ExecuteScalars(vtkIdType theNbOfTuples,
- vtkIdType theScalarMode,
- TDataSetAttributesType* theInputData,
- TDataSetAttributesType* theOutputData)
+ExecuteScalars(vtkIdType theNbOfTuples,
+ vtkIdType theScalarMode,
+ TDataSetAttributesType* theInputData,
+ TDataSetAttributesType* theOutputData)
{
- if(theNbOfTuples < 1)
+ if (theNbOfTuples < 1)
return;
vtkDataArray* aFieldArray = theInputData->GetArray("VISU_FIELD");
void *anInputPtr = aFieldArray->GetVoidPointer(0);
void *anOutputPtr = anOutputScalars->GetVoidPointer(0);
- if(theScalarMode == 0){
- switch(anInputDataType){
+ if (theScalarMode == 0) {
+ switch (anInputDataType) {
vtkTemplateMacro3(Module2Scalars,
- aFieldArray,
- (VTK_TT *)(anOutputPtr),
- theNbOfTuples);
+ aFieldArray,
+ (VTK_TT *)(anOutputPtr),
+ theNbOfTuples);
default:
break;
}
- }else{
- switch(anInputDataType){
+ } else {
+ switch (anInputDataType) {
vtkTemplateMacro5(Component2Scalars,
- aFieldArray,
- (VTK_TT *)(anInputPtr),
- (VTK_TT *)(anOutputPtr),
- theNbOfTuples,
- theScalarMode - 1);
+ aFieldArray,
+ (VTK_TT *)(anInputPtr),
+ (VTK_TT *)(anOutputPtr),
+ theNbOfTuples,
+ theScalarMode - 1);
default:
break;
}
}
-
+
theOutputData->SetScalars(anOutputScalars);
anOutputScalars->Delete();
}
+//---------------------------------------------------------------
+template<typename TDataSetAttributesType> void
+CutScalars(vtkIdType theNbOfTuples,
+ TDataSetAttributesType* theData)
+{
+ if (theNbOfTuples < 1)
+ return;
+
+ vtkDataArray *aScalars = theData->GetScalars();
+ if (!aScalars)
+ return;
+
+ vtkIdType aDataType = aScalars->GetDataType();
+ void *aPtr = aScalars->GetVoidPointer(0);
+
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ int aDecimals = aResourceMgr->integerValue("VISU", "floating_point_precision", 6);
+
+ switch(aDataType) {
+ vtkTemplateMacro3(CutScalarsTempl,
+ (VTK_TT *)(aPtr),
+ theNbOfTuples,
+ aDecimals);
+ default:
+ break;
+ }
+}
//---------------------------------------------------------------
int
VISU_Extractor
::RequestData(vtkInformation *theRequest,
- vtkInformationVector **theInputVector,
- vtkInformationVector *theOutputVector)
+ vtkInformationVector **theInputVector,
+ vtkInformationVector *theOutputVector)
{
vtkDataSet *anInput = VISU::GetInput( theInputVector, 0 );
vtkDataSet *anOutput = VISU::GetOutput( theOutputVector );
vtkPointData *anInputPointData = anInput->GetPointData();
vtkPointData *anOutputPointData = anOutput->GetPointData();
- anOutputPointData->PassData( anInputPointData );
+ anOutputPointData->PassData( anInputPointData );
if ( VISU::IsDataOnPoints( anInput ) ) {
int aNbElems = anInput->GetNumberOfPoints();
if ( anInputPointData->GetAttribute( vtkDataSetAttributes::VECTORS ) )
ExecuteScalars( aNbElems, myScalarMode, anInputPointData, anOutputPointData );
+ CutScalars( aNbElems, anOutputPointData );
}
-
+
vtkCellData *anInputCellData = anInput->GetCellData();
vtkCellData *anOutputCellData = anOutput->GetCellData();
- anOutputCellData->PassData( anInputCellData );
+ anOutputCellData->PassData( anInputCellData );
if ( VISU::IsDataOnCells( anInput ) ) {
int aNbElems = anInput->GetNumberOfCells();
if ( anInputCellData->GetAttribute( vtkDataSetAttributes::VECTORS ) )
ExecuteScalars( aNbElems, myScalarMode, anInputCellData, anOutputCellData );
+ CutScalars( aNbElems, anOutputCellData );
}
return 1;
// File : VISU_LookupTable.cxx
// Author : Vitaliy Smetannikov
// Module : VISU
-//
+
#include "VISU_LookupTable.hxx"
#include <vtkObjectFactory.h>
VISU_LookupTable
::VISU_LookupTable(int sze, int ext):
- vtkLookupTable(sze, ext),
- myScale(1.0),
- myBicolor(false)
+ vtkLookupTable(sze, ext),
+ myScale(1.0),
+ myBicolor(false)
{}
-void
+void
VISU_LookupTable
::SetMapScale(vtkFloatingPointType theScale)
{
}
-int
+int
VISU_LookupTable
-::ComputeLogRange(vtkFloatingPointType inRange[2],
- vtkFloatingPointType outRange[2])
+::ComputeLogRange(vtkFloatingPointType inRange[2],
+ vtkFloatingPointType outRange[2])
{
if(inRange[0] >= inRange[1])
return -1;
return -1;
}
-unsigned char*
+unsigned char*
VISU_LookupTable
-::MapValue(vtkFloatingPointType v)
+::MapValue(vtkFloatingPointType v)
{
if(GetScale() == VTK_SCALE_LOG10) {
vtkFloatingPointType aLowBound = log10(this->TableRange[0]);
}
// Apply log to value, with appropriate constraints.
-inline
-vtkFloatingPointType
-VISU_ApplyLogScale(vtkFloatingPointType v,
- vtkFloatingPointType range[2],
- vtkFloatingPointType logRange[2])
+inline
+vtkFloatingPointType
+VISU_ApplyLogScale(vtkFloatingPointType v,
+ vtkFloatingPointType range[2],
+ vtkFloatingPointType logRange[2])
{
// is the range set for negative numbers?
if (range[0] < 0)
}
}
return v;
-}
+}
// Apply shift/scale to the scalar value v and do table lookup.
-inline
+inline
unsigned char *
-VISU_LinearLookup(vtkFloatingPointType v,
- unsigned char *table,
- vtkFloatingPointType maxIndex,
- vtkFloatingPointType shift,
- vtkFloatingPointType scale,
- bool bicolor)
+VISU_LinearLookup(vtkFloatingPointType v,
+ unsigned char *table,
+ vtkFloatingPointType maxIndex,
+ vtkFloatingPointType shift,
+ vtkFloatingPointType scale,
+ bool bicolor)
{
if( !bicolor )
{
// of 8-bit chunks
template<class T>
void
-VISU_LookupTableMapData(vtkLookupTable *self,
- T *input,
- unsigned char *output,
- int length,
- int inIncr,
- int outFormat,
- vtkFloatingPointType theMapScale,
- bool bicolor)
+VISU_LookupTableMapData(vtkLookupTable *self,
+ T *input,
+ unsigned char *output,
+ int length,
+ int inIncr,
+ int outFormat,
+ vtkFloatingPointType theMapScale,
+ bool bicolor)
{
int i = length;
vtkFloatingPointType *range = self->GetTableRange();
unsigned char *cptr;
vtkFloatingPointType alpha;
- if ( (alpha=self->GetAlpha()) >= 1.0 ) //no blending required
+ if ( (alpha=self->GetAlpha()) >= 1.0 ) //no blending required
{
if (self->GetScale() == VTK_SCALE_LOG10)
{
*/
if (outFormat == VTK_RGBA)
{
- while (--i >= 0)
+ while (--i >= 0)
{
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
- *output++ = *cptr++;
input += inIncr;
}
}
else if (outFormat == VTK_RGB)
{
- while (--i >= 0)
+ while (--i >= 0)
{
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
}
else if (outFormat == VTK_LUMINANCE_ALPHA)
{
- while (--i >= 0)
+ while (--i >= 0)
{
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
*output++ = cptr[3];
input += inIncr;
}
else // outFormat == VTK_LUMINANCE
{
- while (--i >= 0)
+ while (--i >= 0)
{
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
input += inIncr;
}
if (outFormat == VTK_RGBA)
{
- while (--i >= 0)
+ while (--i >= 0)
{
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
- *output++ = *cptr++;
input += inIncr;
}
}
else if (outFormat == VTK_RGB)
{
- while (--i >= 0)
+ while (--i >= 0)
{
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
}
else if (outFormat == VTK_LUMINANCE_ALPHA)
{
- while (--i >= 0)
+ while (--i >= 0)
{
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
*output++ = cptr[3];
input += inIncr;
}
else // outFormat == VTK_LUMINANCE
{
- while (--i >= 0)
+ while (--i >= 0)
{
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
input += inIncr;
}
*/
if (outFormat == VTK_RGBA)
{
- while (--i >= 0)
+ while (--i >= 0)
{
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
}
else if (outFormat == VTK_RGB)
{
- while (--i >= 0)
+ while (--i >= 0)
{
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
}
else if (outFormat == VTK_LUMINANCE_ALPHA)
{
- while (--i >= 0)
+ while (--i >= 0)
{
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
*output++ = static_cast<unsigned char>(alpha*cptr[3]);
input += inIncr;
}
else // outFormat == VTK_LUMINANCE
{
- while (--i >= 0)
+ while (--i >= 0)
{
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
input += inIncr;
}
if (outFormat == VTK_RGBA)
{
- while (--i >= 0)
+ while (--i >= 0)
{
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
}
else if (outFormat == VTK_RGB)
{
- while (--i >= 0)
+ while (--i >= 0)
{
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
}
else if (outFormat == VTK_LUMINANCE_ALPHA)
{
- while (--i >= 0)
+ while (--i >= 0)
{
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
*output++ = static_cast<unsigned char>(cptr[3]*alpha);
input += inIncr;
}
else // outFormat == VTK_LUMINANCE
{
- while (--i >= 0)
+ while (--i >= 0)
{
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
input += inIncr;
}
// for subsequent renders.
template<class T>
void
-VISU_LookupTableMapMag(vtkLookupTable *self,
- T *input,
- unsigned char *output,
- int length,
- int inIncr,
- int outFormat,
- vtkFloatingPointType theMapScale,
- bool bicolor)
+VISU_LookupTableMapMag(vtkLookupTable *self,
+ T *input,
+ unsigned char *output,
+ int length,
+ int inIncr,
+ int outFormat,
+ vtkFloatingPointType theMapScale,
+ bool bicolor)
{
double tmp, sum;
double *mag;
sum = 0;
for (j = 0; j < inIncr; ++j)
{
- tmp = (double)(*input);
+ tmp = (double)(*input);
sum += (tmp * tmp);
++input;
}
}
-void VISU_LookupTable::MapScalarsThroughTable2(void *input,
- unsigned char *output,
- int inputDataType,
- int numberOfValues,
- int inputIncrement,
- int outputFormat)
+void VISU_LookupTable::MapScalarsThroughTable2(void *input,
+ unsigned char *output,
+ int inputDataType,
+ int numberOfValues,
+ int inputIncrement,
+ int outputFormat)
{
if (this->UseMagnitude && inputIncrement > 1)
{
break;
case VTK_CHAR:
VISU_LookupTableMapMag(this,static_cast<char *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
- return;
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ return;
case VTK_UNSIGNED_CHAR:
VISU_LookupTableMapMag(this,static_cast<unsigned char *>(input),output,
numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
newInput->SetValue(i, bitArray->GetValue(id));
}
VISU_LookupTableMapData(this,
- static_cast<unsigned char*>(newInput->GetPointer(0)),
- output,numberOfValues,
- inputIncrement,outputFormat,myScale,myBicolor);
+ static_cast<unsigned char*>(newInput->GetPointer(0)),
+ output,numberOfValues,
+ inputIncrement,outputFormat,myScale,myBicolor);
newInput->Delete();
bitArray->Delete();
}
break;
-
+
case VTK_CHAR:
VISU_LookupTableMapData(this,static_cast<char *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_UNSIGNED_CHAR:
VISU_LookupTableMapData(this,static_cast<unsigned char *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_SHORT:
VISU_LookupTableMapData(this,static_cast<short *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_UNSIGNED_SHORT:
VISU_LookupTableMapData(this,static_cast<unsigned short *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_INT:
VISU_LookupTableMapData(this,static_cast<int *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_UNSIGNED_INT:
VISU_LookupTableMapData(this,static_cast<unsigned int *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_LONG:
VISU_LookupTableMapData(this,static_cast<long *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_UNSIGNED_LONG:
VISU_LookupTableMapData(this,static_cast<unsigned long *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_FLOAT:
VISU_LookupTableMapData(this,static_cast<float *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_DOUBLE:
VISU_LookupTableMapData(this,static_cast<double *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
default:
vtkErrorMacro(<< "MapImageThroughTable: Unknown input ScalarType");
return;
}
-}
-
+}
// Author :
// Module : VISU
// $Header$
-//
+
#include "VisuGUI.h"
// STL Includes
if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()");
if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) )
return;
-
+
SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
// Get file name(s)
aFilter.append( tr( "FLT_MED_FILES" ) );
aFilter.append( tr( "FLT_DISTRIBUTED_MED_FILES" ) );
aFilter.append( tr( "FLT_ALL_FILES" ) );
-
+
bool toUseBuildProgress = aResourceMgr->booleanValue("VISU", "use_build_progress", false);
SalomeApp_CheckFileDlg fd( GetDesktop(this), true, tr("USE_BUILD_PROGRESS") );
fd.setCaption( tr( "IMPORT_FROM_FILE" ) );
- fd.setMode( SalomeApp_CheckFileDlg::ExistingFiles );
+ fd.setMode( SalomeApp_CheckFileDlg::ExistingFiles );
fd.setFilters( aFilter );
fd.SetChecked( toUseBuildProgress );
if ( SalomeApp_CheckFileDlg::getLastVisitedPath().isEmpty() )
for ( QStringList::ConstIterator it = fileNames.begin(); it != fileNames.end(); ++it ) {
QFileInfo aFileInfo( *it );
-
+
if ( !aFileInfo.exists() ) {
// file not exist
errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
- arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
+ arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
}
else {
try {
- if ( !toUseBuildProgress ) {
- // build progress is not used, use build flags from settings
- bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields", true );
- bool toBuildMinMax = aResourceMgr->booleanValue( "VISU", "build_min_max", true );
- bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true );
- bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
- bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false );
-
- QString anInfo( tr( "IMPORT_FROM_FILE" ) + " " + aFileInfo.filePath() + " ... " );
- application()->putInfo( anInfo );
-
- VISU::Result_var aResult = GetVisuGen( this )->CreateResult( aFileInfo.filePath() );
-
- if ( CORBA::is_nil( aResult.in() ) ) {
- errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
- arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
- }
- else {
- aResult->SetBuildFields( toBuildFields, toBuildMinMax );
- aResult->SetBuildGroups( toBuildGroups );
- aResult->Build( toBuildAll, toBuildAtOnce );
- application()->putInfo( anInfo + tr("INF_DONE") );
- }
- } // if ( !toUseBuildProgress )
- else {
- // use build progress
- wc.suspend();
- VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
- aBuildProgressDlg->setFileName( aFileInfo.filePath() );
- aBuildProgressDlg->setGenerator( GetVisuGen(this) );
- aBuildProgressDlg->exec();
- wc.resume();
- }
+ if ( !toUseBuildProgress ) {
+ // build progress is not used, use build flags from settings
+ bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields", true );
+ bool toBuildMinMax = aResourceMgr->booleanValue( "VISU", "build_min_max", true );
+ bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true );
+ bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
+ bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false );
+
+ QString anInfo( tr( "IMPORT_FROM_FILE" ) + " " + aFileInfo.filePath() + " ... " );
+ application()->putInfo( anInfo );
+
+ VISU::Result_var aResult = GetVisuGen( this )->CreateResult( aFileInfo.filePath() );
+
+ if ( CORBA::is_nil( aResult.in() ) ) {
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
+ arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
+ }
+ else {
+ aResult->SetBuildFields( toBuildFields, toBuildMinMax );
+ aResult->SetBuildGroups( toBuildGroups );
+ aResult->Build( toBuildAll, toBuildAtOnce );
+ application()->putInfo( anInfo + tr("INF_DONE") );
+ }
+ } // if ( !toUseBuildProgress )
+ else {
+ // use build progress
+ wc.suspend();
+ VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
+ aBuildProgressDlg->setFileName( aFileInfo.filePath() );
+ aBuildProgressDlg->setGenerator( GetVisuGen(this) );
+ aBuildProgressDlg->exec();
+ wc.resume();
+ }
} // try
catch(...) {
- errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
}
} // else // if ( !aFileInfo.exists() )
} // for (...)
if ( errors.count() > 0 ) {
SUIT_MessageBox::error1( GetDesktop(this),
- tr("ERR_ERROR"),
- tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ),
- tr("BUT_OK") );
+ tr("ERR_ERROR"),
+ tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ),
+ tr("BUT_OK") );
}
else {
UpdateObjBrowser(this);
anInitialPath = QDir::currentDirPath();
QStringList aFiles = SUIT_FileDlg::getOpenFileNames(GetDesktop(this),
- anInitialPath,
- aFilter,
- tr("TLT_IMPORT_TABLE"));
+ anInitialPath,
+ aFilter,
+ tr("TLT_IMPORT_TABLE"));
if ( aFiles.count() == 0 )
return; // nothing selected
if ( !aFileInfo.exists() ) {
errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
- arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
+ arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
}
else {
try {
- QString anInfo( tr("TLT_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
- application()->putInfo( anInfo );
-
- CORBA::Object_var anObject = GetVisuGen(this)->ImportTables(aFileInfo.filePath());
-
- if (CORBA::is_nil(anObject.in())) {
- errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
- arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
- }
- else {
- application()->putInfo( anInfo + tr("INF_DONE") );
- }
+ QString anInfo( tr("TLT_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
+ application()->putInfo( anInfo );
+
+ CORBA::Object_var anObject = GetVisuGen(this)->ImportTables(aFileInfo.filePath());
+
+ if (CORBA::is_nil(anObject.in())) {
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
+ arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
+ }
+ else {
+ application()->putInfo( anInfo + tr("INF_DONE") );
+ }
}
catch(...) {
- errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
}
}
}
if ( errors.count() > 0 ) {
SUIT_MessageBox::error1( GetDesktop(this),
- tr("ERR_ERROR"),
- tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ),
- tr("BUT_OK") );
+ tr("ERR_ERROR"),
+ tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ),
+ tr("BUT_OK") );
}
else {
UpdateObjBrowser(this);
if (!aTabAttr) return;
aTitle = aTabAttr->GetTitle().c_str();
} else {
- _PTR(AttributeTableOfInteger) aTabAttr (anAttr);
- if (!aTabAttr) return;
+ _PTR(AttributeTableOfInteger) aTabAttr (anAttr);
+ if (!aTabAttr) return;
aTitle = aTabAttr->GetTitle().c_str();
}
aTitle.simplifyWhiteSpace();
QString aFile = aFileInfo.filePath();
if (!aFile.isEmpty()) {
application()->putInfo(tr("MEN_EXPORT_TABLE") + " " + aFile + " ...");
- aDir = Qtx::dir(aFile, true);
+ aDir = Qtx::dir(aFile, true);
aResourceMgr->setValue("VISU", "OutputDir", aDir);
- try {
- GetVisuGen(this)->ExportTableToFile(GetSObject(aSObj), aFile.latin1());
+ try {
+ GetVisuGen(this)->ExportTableToFile(GetSObject(aSObj), aFile.latin1());
application()->putInfo(aFile + " " + tr("INF_DONE"));
- } catch(std::exception& exc) {
- INFOS(exc.what());
- SUIT_MessageBox::warn1(GetDesktop(this),
+ } catch(std::exception& exc) {
+ INFOS(exc.what());
+ SUIT_MessageBox::warn1(GetDesktop(this),
tr("WRN_VISU"),
- tr("ERR_ERROR_DURING_EXPORT") + " " + tr(exc.what()),
- tr("BUT_OK"));
- } catch(...) {
- INFOS(tr("ERR_ERROR_DURING_EXPORT"));
- SUIT_MessageBox::warn1(GetDesktop(this),
+ tr("ERR_ERROR_DURING_EXPORT") + " " + tr(exc.what()),
+ tr("BUT_OK"));
+ } catch(...) {
+ INFOS(tr("ERR_ERROR_DURING_EXPORT"));
+ SUIT_MessageBox::warn1(GetDesktop(this),
tr("WRN_VISU"),
- tr("ERR_ERROR_DURING_EXPORT"),
- tr("BUT_OK") );
- }
+ tr("ERR_ERROR_DURING_EXPORT"),
+ tr("BUT_OK") );
+ }
}
}
}
CORBA::String_var aCompDataType = aSComp->ComponentDataType();
QString anInfo ("Loading ");
- anInfo = anInfo + aCompDataType.in() + " Component Data ...";
+ anInfo = anInfo + aCompDataType.in() + " Component Data ...";
application()->putInfo( anInfo );
// obtain a driver by a component data type
if( aTblObj ) {
_PTR(GenericAttribute) anAttr;
if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
- _PTR(ChildIterator) aChildIter = aStudy->NewChildIterator( aTblObj );
- SalomeApp_Study* salome_study = GetAppStudy( theModule );
- for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ){
- salome_study->deleteReferencesTo( aChildIter->Value() );
- _PTR(SObject) aSO = aChildIter->Value();
- if(aSO){
- Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSO);
- if (aRestoringMap["myComment"] == "CURVE") {
- CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSO);
- if(!CORBA::is_nil(aCORBAObject)){
- PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
- if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aServant.in())){
- PlotRemoveCurve(theModule, aCurve);
- }
- }
- }
- }
-
- }
+ _PTR(ChildIterator) aChildIter = aStudy->NewChildIterator( aTblObj );
+ SalomeApp_Study* salome_study = GetAppStudy( theModule );
+ for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ){
+ salome_study->deleteReferencesTo( aChildIter->Value() );
+ _PTR(SObject) aSO = aChildIter->Value();
+ if(aSO){
+ Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSO);
+ if (aRestoringMap["myComment"] == "CURVE") {
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSO);
+ if(!CORBA::is_nil(aCORBAObject)){
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aServant.in())){
+ PlotRemoveCurve(theModule, aCurve);
+ }
+ }
+ }
+ }
+ }
aBuilder->RemoveObjectWithChildren( aTblObj ); // We should have only one child
- //UpdateObjBrowser(theModule,true,aTblObj);
+ //UpdateObjBrowser(theModule,true,aTblObj);
break;
}
}
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
// Get selected SObject
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
Handle(SALOME_InteractiveObject) anIO = it.Value();
TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
VISU::Base_i* aBase = anObjectInfo.myBase;
- if(!aBase)
+ if(!aBase)
continue;
-
+
VISU::VISUType aType = aBase->GetType();
switch (aType) {
- case VISU::TCURVE:
+ case VISU::TCURVE:
case VISU::TCONTAINER:
- case VISU::TTABLE:
+ case VISU::TTABLE:
displayer()->Display(anIO->getEntry());
break;
- case VISU::TPOINTMAP3D:
+ case VISU::TPOINTMAP3D:
if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
- displayer()->Display(anIO->getEntry());
- aViewWindow->highlight(anIO, 1);
- aViewWindow->getRenderer()->ResetCameraClippingRange();
- aViewWindow->Repaint();
+ displayer()->Display(anIO->getEntry());
+ aViewWindow->highlight(anIO, 1);
+ aViewWindow->getRenderer()->ResetCameraClippingRange();
+ aViewWindow->Repaint();
}
else
- displayer()->Display(anIO->getEntry());
+ displayer()->Display(anIO->getEntry());
break;
default: {
VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dFromBase(aBase);
if(aPrs3d){
- if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
- displayer()->Display(anIO->getEntry());
- aViewWindow->highlight(anIO, 1);
- aViewWindow->getRenderer()->ResetCameraClippingRange();
- aViewWindow->Repaint();
- }
+ if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
+ displayer()->Display(anIO->getEntry());
+ aViewWindow->highlight(anIO, 1);
+ aViewWindow->getRenderer()->ResetCameraClippingRange();
+ aViewWindow->Repaint();
+ }
}
}
}
for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
if (anActor->GetVisibility() > 0)
if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
- RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d());
+ RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d());
anVISUActor->VisibilityOff();
}
}
//----------------------------------------------------------------------------
VISU::Prs3d_i*
GetPrsToModify(const SalomeApp_Module* theModule,
- Handle(SALOME_InteractiveObject)& theIO)
+ Handle(SALOME_InteractiveObject)& theIO)
{
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
if(aSelectionInfo.empty())
//----------------------------------------------------------------------------
bool
GetPrs3dSelectionInfo(const SalomeApp_Module* theModule,
- VISU::Prs3d_i*& thePrs3d,
- SVTK_ViewWindow*& theViewWindow,
- VISU_Actor*& thenActor)
+ VISU::Prs3d_i*& thePrs3d,
+ SVTK_ViewWindow*& theViewWindow,
+ VISU_Actor*& thenActor)
{
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
if(aSelectionInfo.empty())
return false;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
thePrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
if(!thePrs3d)
return false;
-
+
theViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
if(!theViewWindow)
return false;
-
+
thenActor = FindActor(theViewWindow, thePrs3d);
if(!thenActor)
return false;
-
+
return true;
}
}
SVTK_ViewWindow* aViewWindow = NULL;
if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
return;
-
+
VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
VISU::DeformedShape_i* aDeformedShape = dynamic_cast<VISU::DeformedShape_i*>(aPrs3d);
SVTK_ViewWindow* aViewWindow = NULL;
if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
return;
-
+
VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
if(!aMesh)
return;
SALOMEDS::Color anOldColor = aMesh->GetLinkColor(), aNewColor;
QColor aColor (int(255*anOldColor.R),
- int(255*anOldColor.G),
- int(255*anOldColor.B));
+ int(255*anOldColor.G),
+ int(255*anOldColor.B));
QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
if (aColorNew.isValid()) {
aNewColor.R = aColorNew.red()/255.;
VisuGUI_CursorDlg* CursorDlg =
new VisuGUI_CursorDlg (GetDesktop(this), tr("DLG_LINEWIDTH_TITLE"), TRUE);
-
+
CursorDlg->helpFileName = "viewing_3d_presentations_intro_page.html#width_opacity_anchor";
CursorDlg->Comment1->setText(tr("DLG_LINEWIDTH_CMT1"));
CursorDlg->Comment2->setText(tr("DLG_LINEWIDTH_CMT2"));
int intlwid = int(oldlwid);
CursorDlg->SpinBox1->setValue(intlwid);
-
+
int ret = CursorDlg->exec();
if (ret == 1) {
intlwid = CursorDlg->SpinBox1->value();
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase))
aSObject = GetCStudy( GetAppStudy( this ) )->FindObjectID( aTable->GetObjectEntry() );
-
+
if( !IsSObjectTable( aSObject ) )
return;
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
anIO = it.Value();
if (anIO->hasEntry()) {
if (IsRemovable(anIO->getEntry(), this)) {
- aNameList.append("\n - ");
- // Get Name Of the Main Object if it's a referenced object
- VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
- if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
- _PTR(SObject) aRefSObject;
- if (aSObject->ReferencedObject(aRefSObject)) {
- QString aRefName ( aRefSObject->GetName() );
- aNameList.append( aRefName );
- }
- else
- aNameList.append(anIO->getName());
- }
+ aNameList.append("\n - ");
+ // Get Name Of the Main Object if it's a referenced object
+ VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
+ if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
+ _PTR(SObject) aRefSObject;
+ if (aSObject->ReferencedObject(aRefSObject)) {
+ QString aRefName ( aRefSObject->GetName() );
+ aNameList.append( aRefName );
+ }
+ else
+ aNameList.append(anIO->getName());
+ }
anEntries[i++] = anIO->getEntry();
}
}
}
if ( SUIT_MessageBox::warn2( GetDesktop(this),
- QObject::tr( "WRN_VISU" ),
- QObject::tr( "VISU_REALLY_DELETE" ).arg( nbSelected ).arg( aNameList ),
- QObject::tr( "BUT_YES" ),
- QObject::tr( "BUT_NO" ), 1, 0, 0 ) != 1 )
+ QObject::tr( "WRN_VISU" ),
+ QObject::tr( "VISU_REALLY_DELETE" ).arg( nbSelected ).arg( aNameList ),
+ QObject::tr( "BUT_YES" ),
+ QObject::tr( "BUT_NO" ), 1, 0, 0 ) != 1 )
return;
// There is a transaction
if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
_PTR(SObject) aRefSObject;
if (aSObject->ReferencedObject(aRefSObject)) {
- // It can be a reference on curve, published under a container.
- // In this case the curve should be removed from the container.
- // See bug 10441.
- VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(this), aRefSObject->GetID());
- VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
- if(aRefBase && aRefBase->GetType() == VISU::TMESH){
- DeleteSObject(this, aCStudy, aRefSObject);
- UpdateObjBrowser(this, true, aRefSObject);
- }else if(aRefBase && aRefBase->GetType() == VISU::TCURVE){
- CORBA::Object_var anObject = ClientSObjectToObject(aRefSObject);
- VISU::Curve_var aCurve = VISU::Curve::_narrow(anObject);
- _PTR(SObject) aParentSO = aSObject->GetFather();
- VISU::TObjectInfo aParentObjectInfo = GetObjectByEntry(GetAppStudy(this), aParentSO->GetID());
- if(VISU::Base_i* aParentBase = aParentObjectInfo.myBase){
- if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aParentBase)){
- if(aContainer->GetNbCurves() > 0){
- aContainer->RemoveCurve(aCurve);
- UpdateObjBrowser(this, true, aParentSO);
- }
- }
- }
- }
+ // It can be a reference on curve, published under a container.
+ // In this case the curve should be removed from the container.
+ // See bug 10441.
+ VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(this), aRefSObject->GetID());
+ VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
+ if(aRefBase && aRefBase->GetType() == VISU::TMESH){
+ DeleteSObject(this, aCStudy, aRefSObject);
+ UpdateObjBrowser(this, true, aRefSObject);
+ }else if(aRefBase && aRefBase->GetType() == VISU::TCURVE){
+ CORBA::Object_var anObject = ClientSObjectToObject(aRefSObject);
+ VISU::Curve_var aCurve = VISU::Curve::_narrow(anObject);
+ _PTR(SObject) aParentSO = aSObject->GetFather();
+ VISU::TObjectInfo aParentObjectInfo = GetObjectByEntry(GetAppStudy(this), aParentSO->GetID());
+ if(VISU::Base_i* aParentBase = aParentObjectInfo.myBase){
+ if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aParentBase)){
+ if(aContainer->GetNbCurves() > 0){
+ aContainer->RemoveCurve(aCurve);
+ UpdateObjBrowser(this, true, aParentSO);
+ }
+ }
+ }
+ }
}
else{
- DeleteSObject(this, aCStudy, aSObject);
- UpdateObjBrowser(this, true, aSObject);
+ DeleteSObject(this, aCStudy, aSObject);
+ UpdateObjBrowser(this, true, aSObject);
}
}
}
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
if(aBase->GetType() == VISU::TTABLE || aBase->GetType() == VISU::TPOINTMAP3D) {
if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase)){
- _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
- _PTR(SObject) aSObject = aStudy->FindObjectID( aTable->GetObjectEntry() );
- if(IsSObjectTable(aSObject)){
- VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
- if(aDlg->exec() == QDialog::Accepted){
- if(!IsStudyLocked(aStudy)){
- // if study is not locked - create new container, create curves and insert them
- // into container, then plot container if current viewer is of VIEW_PLOT2D type
- int horIndex;
- QValueList<int> verIndices, zIndices;
- aDlg->getCurvesSource( horIndex, verIndices, zIndices );
- if( horIndex >= 0 && verIndices.count() > 0 ){
- CORBA::Object_var aContainerObj = GetVisuGen(this)->CreateContainer();
- if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObj).in())){
- for( int i = 0; i < verIndices.count(); i++ ){
- VISU::Curve_var aCurveObject =
- GetVisuGen(this)->CreateCurveWithZ(aTable->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1 );
- if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
- bool isAuto;
- int marker, line, lineWidth;
- QColor color;
- if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
- line, lineWidth, color) && !isAuto )
- {
- SALOMEDS::Color c;
- c.R = color.red() /255.;
- c.G = color.green()/255.;
- c.B = color.blue() /255.;
- aCurve->SetColor( c );
- aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
- aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
- }
- aContainer->AddCurve(aCurveObject);
- }
- }
- UpdateObjBrowser(this);
- PlotContainer( this, aContainer, VISU::eDisplay );
- }
- }
- } else {
- // get name of SObject
- QString aSObjectName;
- _PTR(GenericAttribute) anAttr;
- if(aSObject->FindAttribute( anAttr, "AttributeName" )){
- _PTR(AttributeName) aName = anAttr;
- aSObjectName = QString( aName->Value().c_str() );
- }
- // if study is locked just get curves info and plot them
- // if current viewer is of VIEW_PLOT2D type
- QPtrList<Plot2d_Curve> container;
- aDlg->getCurves( container );
- if ( !container.isEmpty() ) {
- GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
- GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( aSObjectName );
- }
- }
- }
- delete aDlg;
- }
+ _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
+ _PTR(SObject) aSObject = aStudy->FindObjectID( aTable->GetObjectEntry() );
+ if(IsSObjectTable(aSObject)){
+ VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
+ if(aDlg->exec() == QDialog::Accepted){
+ if(!IsStudyLocked(aStudy)){
+ // if study is not locked - create new container, create curves and insert them
+ // into container, then plot container if current viewer is of VIEW_PLOT2D type
+ int horIndex;
+ QValueList<int> verIndices, zIndices;
+ aDlg->getCurvesSource( horIndex, verIndices, zIndices );
+ if( horIndex >= 0 && verIndices.count() > 0 ){
+ CORBA::Object_var aContainerObj = GetVisuGen(this)->CreateContainer();
+ if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObj).in())){
+ for( int i = 0; i < verIndices.count(); i++ ){
+ VISU::Curve_var aCurveObject =
+ GetVisuGen(this)->CreateCurveWithZ(aTable->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1 );
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
+ bool isAuto;
+ int marker, line, lineWidth;
+ QColor color;
+ if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
+ line, lineWidth, color) && !isAuto )
+ {
+ SALOMEDS::Color c;
+ c.R = color.red() /255.;
+ c.G = color.green()/255.;
+ c.B = color.blue() /255.;
+ aCurve->SetColor( c );
+ aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
+ aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
+ }
+ aContainer->AddCurve(aCurveObject);
+ }
+ }
+ UpdateObjBrowser(this);
+ PlotContainer( this, aContainer, VISU::eDisplay );
+ }
+ }
+ } else {
+ // get name of SObject
+ QString aSObjectName;
+ _PTR(GenericAttribute) anAttr;
+ if(aSObject->FindAttribute( anAttr, "AttributeName" )){
+ _PTR(AttributeName) aName = anAttr;
+ aSObjectName = QString( aName->Value().c_str() );
+ }
+ // if study is locked just get curves info and plot them
+ // if current viewer is of VIEW_PLOT2D type
+ QPtrList<Plot2d_Curve> container;
+ aDlg->getCurves( container );
+ if ( !container.isEmpty() ) {
+ GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
+ GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( aSObjectName );
+ }
+ }
+ }
+ delete aDlg;
+ }
}
}
}else if(!aSelectionItem.myIO.IsNull()){
if(IsSObjectTable(aSObject)){
VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
if(aDlg->exec() == QDialog::Accepted){
- _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
+ _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
if(!IsStudyLocked(aStudy)){
// if study is not locked - create new table and container objects, create curves
// and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
if ( horIndex >= 0 && verIndices.count() > 0 ) {
VISU::Table_var aTableObject = GetVisuGen(this)->CreateTable(aSObject->GetID().c_str());
if(!CORBA::is_nil(aTableObject)){
- VISU::Container_var aContainerObject = GetVisuGen(this)->CreateContainer();
+ VISU::Container_var aContainerObject = GetVisuGen(this)->CreateContainer();
VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObject).in());
- for ( int i = 0; i < verIndices.count(); i++ ) {
- VISU::Curve_var aCurveObject = GetVisuGen(this)->CreateCurveWithZ
- ( aTableObject, horIndex+1, verIndices[i]+1, zIndices[i]+1 );
- if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
- bool isAuto;
- int marker, line, lineWidth;
- QColor color;
- if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
- line, lineWidth, color) && !isAuto )
- {
- SALOMEDS::Color c;
- c.R = color.red()/255.;
- c.G = color.green()/255.;
- c.B = color.blue()/255.;
- aCurve->SetColor( c );
- aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
- aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
- }
- aContainerObject->AddCurve(aCurveObject);
- }
- }
- UpdateObjBrowser(this);
- PlotContainer( this, aContainer, VISU::eDisplay );
- }
- }
+ for ( int i = 0; i < verIndices.count(); i++ ) {
+ VISU::Curve_var aCurveObject = GetVisuGen(this)->CreateCurveWithZ
+ ( aTableObject, horIndex+1, verIndices[i]+1, zIndices[i]+1 );
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
+ bool isAuto;
+ int marker, line, lineWidth;
+ QColor color;
+ if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
+ line, lineWidth, color) && !isAuto )
+ {
+ SALOMEDS::Color c;
+ c.R = color.red()/255.;
+ c.G = color.green()/255.;
+ c.B = color.blue()/255.;
+ aCurve->SetColor( c );
+ aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
+ aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
+ }
+ aContainerObject->AddCurve(aCurveObject);
+ }
+ }
+ UpdateObjBrowser(this);
+ PlotContainer( this, aContainer, VISU::eDisplay );
+ }
+ }
} else {
- // get name of SObject
- QString aSObjectName;
- _PTR(GenericAttribute) anAttr;
- if(aSObject->FindAttribute(anAttr, "AttributeName")){
- _PTR(AttributeName) aName = anAttr;
- aSObjectName = QString( aName->Value().c_str() );
- }
+ // get name of SObject
+ QString aSObjectName;
+ _PTR(GenericAttribute) anAttr;
+ if(aSObject->FindAttribute(anAttr, "AttributeName")){
+ _PTR(AttributeName) aName = anAttr;
+ aSObjectName = QString( aName->Value().c_str() );
+ }
// if study is locked just get curves info and plot them
QPtrList<Plot2d_Curve> container;
aDlg->getCurves( container );
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
- if(!aBase)
+ if(!aBase)
return;
if(aBase->GetType() == VISU::TCURVE) {
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
if(!aBase)
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
if(!aBase)
return;
VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase);
- if(!aContainer)
+ if(!aContainer)
return;
VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (this);
case VISU::TPOINTMAP3D: { // Table object
if (VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBase)) {
aTable3d->SetTitle(Name);
- aTable3d->UpdateActors();
+ aTable3d->UpdateActors();
}
break;
}
for (int i = 0; i <= aSteps; i++) {
try {
float aPercents;
- float aT;
- if( aMode >= 1 )
- aT = ( is2Pi == 1 ? -PI + 2. * PI * float(i)/aSteps : PI * float(i)/aSteps );
+ float aT;
+ if( aMode >= 1 )
+ aT = ( is2Pi == 1 ? -PI + 2. * PI * float(i)/aSteps : PI * float(i)/aSteps );
if( aMode == 1 ){ //if selected Periodic cosinusoidal mode of sweeping
//This is necessary in order for animation to return to the initial picture
- aPercents = (1.-cos( aT ))/2.;
+ aPercents = (1.-cos( aT ))/2.;
}
else if( aMode == 2 ){ //if selected Periodic sinusoidal mode of sweeping
//This is necessary in order for animation to return to the initial picture
- aPercents = sin( aT - PI/2 );
+ aPercents = sin( aT - PI/2 );
}
else //if selected Linear mode of sweeping
aPercents = float(i)/aSteps;
_PTR(SObject) aSObject = aCStudy->FindObjectID(It.Value()->getEntry());
if ( !aAnimationDlg->addField(aSObject) ) {
SUIT_MessageBox::warn1(GetDesktop(this),
- tr("WRN_VISU"),
- tr("ERR_CANT_CREATE_ANIMATION"),
- tr("BUT_OK"));
+ tr("WRN_VISU"),
+ tr("ERR_CANT_CREATE_ANIMATION"),
+ tr("BUT_OK"));
delete aAnimationDlg;
return;
}
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
_PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
- if (!aSObj)
+ if (!aSObj)
return;
VISU::VISUType aType = VISU::Storable::SObject2Type( aSObj );
- if (aType != VISU::TANIMATION)
+ if (aType != VISU::TANIMATION)
return;
VisuGUI_TimeAnimationDlg* aAnimationDlg =
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
if(!aBase)
createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIconSet(),
tr("MEN_UNSHRINK"), "", 0, aParent, false,
this, SLOT(OnMakeShrink()));
-
+
createAction( VISU_SHADING, tr("MEN_SHADING"), QIconSet(),
tr("MEN_SHADING"), "", 0, aParent, false,
this, SLOT(OnSetShadingOn()));
-
+
createAction( VISU_NOSHADING, tr("MEN_NOSHADING"), QIconSet(),
tr("MEN_NOSHADING"), "", 0, aParent, false,
this, SLOT(OnSetShadingOff()));
int aMenuId;
aMenuId = createMenu( tr( "MEN_DESK_FILE" ), -1 );
createMenu( separator(), aMenuId, -1, 10 );
-
+
int anImportId = createMenu( tr( "MEN_IMPORT" ), aMenuId, -1, 10 );
createMenu( VISU_IMPORT_FROM_FILE, anImportId ); // import from file
createMenu( VISU_IMPORT_TABLE, anImportId ); // import table
mgr->insert( action( VISU_MULTIPR_LOW_RES ), -1, -1, -1 );
mgr->insert( action( VISU_MULTIPR_HIDE ), -1, -1, -1 );
- mgr->insert( action( VISU_FILE_INFO ), -1, -1, -1 );
+ mgr->insert( action( VISU_FILE_INFO ), -1, -1, -1 );
// Rules
QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
"'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
- "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'");
+ "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'");
// VISU root commands
QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule, true );
mgr->setRule( action( VISU_EDIT_SCALARMAP ),
- "selcount=1 and type='VISU::TSCALARMAP'", true );
+ "selcount=1 and type='VISU::TSCALARMAP'", true );
mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
- "selcount=1 and type='VISU::TDEFORMEDSHAPE'", true );
+ "selcount=1 and type='VISU::TDEFORMEDSHAPE'", true );
mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP ),
- "selcount=1 and $type in {'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}", true );
+ "selcount=1 and $type in {'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}", true );
mgr->setRule( action( VISU_EDIT_CUTPLANES ),
- "selcount=1 and type='VISU::TCUTPLANES'", true );
+ "selcount=1 and type='VISU::TCUTPLANES'", true );
mgr->setRule( action( VISU_EDIT_CUTLINES ),
- "selcount=1 and type='VISU::TCUTLINES'", true );
+ "selcount=1 and type='VISU::TCUTLINES'", true );
mgr->setRule( action( VISU_EDIT_ISOSURFACES ),
- "selcount=1 and type='VISU::TISOSURFACES'", true );
+ "selcount=1 and type='VISU::TISOSURFACES'", true );
mgr->setRule( action( VISU_EDIT_VECTORS ),
- "selcount=1 and type='VISU::TVECTORS'", true );
+ "selcount=1 and type='VISU::TVECTORS'", true );
mgr->setRule( action( VISU_EDIT_STREAMLINES ),
- "selcount=1 and type='VISU::TSTREAMLINES'", true );
+ "selcount=1 and type='VISU::TSTREAMLINES'", true );
mgr->setRule( action( VISU_EDIT_PLOT3D ),
- "selcount=1 and type='VISU::TPLOT3D'", true );
+ "selcount=1 and type='VISU::TPLOT3D'", true );
mgr->setRule( action( VISU_EDIT_POINTMAP3D ),
- "selcount=1 and type='VISU::TPOINTMAP3D'", true );
+ "selcount=1 and type='VISU::TPOINTMAP3D'", true );
aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0";
mgr->setRule( action( VISU_CREATE_TABLE ), aRule, true );
mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1", true );
mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1", true );
mgr->setRule( action( VISU_EDIT_PLOT3D ),
- "selcount=1 and type='VISU::TPLOT3D'", true );
+ "selcount=1 and type='VISU::TPLOT3D'", true );
//aRule = "client='ObjectBrowser' and type='MEDFIELD'";
//mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
-
+
aRule = "client='ObjectBrowser' and selcount>=1 and $type in {'VISU::TPART'} and ";
{
QString aCustomRule = aRule + "fullResolution=1 and resolutionState!='F'";
OB_Browser* ob = getApp()->objectBrowser();
bool isOBClient = (ob && theClient == ob->popupClientType());
-
+
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
SALOME_ListIO aListIO;
aSelectionMgr->selectedObjects(aListIO);
SALOME_ListIteratorOfListIO It (aListIO);
for (; It.More(); It.Next()) {
Handle(SALOME_InteractiveObject)& anIO = It.Value();
-
+
if (!anIO.IsNull() && anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
if ( !aSObject )
- continue;
+ continue;
if ( !isOBClient ) {
- QString aName = QString( aSObject->GetName().c_str() );
- while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of popup
- aName.remove( (aName.length() - 1), 1 );
- theTitle = aName;
+ QString aName = QString( aSObject->GetName().c_str() );
+ while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of popup
+ aName.remove( (aName.length() - 1), 1 );
+ theTitle = aName;
}
CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
if (CORBA::is_nil(aCORBAObject)) {
- VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
- if (aType == VISU::TTIMESTAMP) {
- _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
- _PTR(SObject) aPrs;
- for (; anIter->More(); anIter->Next()) {
- aPrs = anIter->Value();
- if (!aPrs)
- continue;
- std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
- nbPrs += aSubList.size();
- }
- }
+ VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
+ if (aType == VISU::TTIMESTAMP) {
+ _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
+ _PTR(SObject) aPrs;
+ for (; anIter->More(); anIter->Next()) {
+ aPrs = anIter->Value();
+ if (!aPrs)
+ continue;
+ std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
+ nbPrs += aSubList.size();
+ }
+ }
}
}
}
if (!anIO.IsNull() && anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
if ( !aSObject )
- continue;
+ continue;
VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
if (aType == VISU::TCURVE) {
- isCurves = true;
+ isCurves = true;
} else {
- VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
- if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
- if (aPrsObject->GetType() == VISU::TCUTPLANES) {
- if (VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject))
- isOneCutPlane = aCutPrs->GetNbPlanes() == 1;
- }
- }
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
+ if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
+ if (aPrsObject->GetType() == VISU::TCUTPLANES) {
+ if (VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject))
+ isOneCutPlane = aCutPrs->GetNbPlanes() == 1;
+ }
+ }
}
}
}
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
}
// Check single selection
- if (aListIO.Extent() != 1)
+ if (aListIO.Extent() != 1)
return;
// Check if the object's data is loaded
{
// TAB: "MED import"
int importTab = addPreference( tr( "MED import" ) );
-
+
// group: "MED files import"
int importGr = addPreference( tr( "MED files import" ), importTab );
setPreferenceProperty( importGr, "columns", 1 );
setPreferenceProperty( numcol, "max", 256 );
addPreference( tr( "VISU_IS_UNITS" ), colorsLabelsGr,
- LightApp_Preferences::Bool, "VISU", "scalar_bar_display_units" );
+ LightApp_Preferences::Bool, "VISU", "scalar_bar_display_units" );
int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
setPreferenceProperty( numlab, "max", 65 );
addPreference( tr( "VISU_LABELS_FORMAT" ), colorsLabelsGr,
- LightApp_Preferences::String, "VISU", "scalar_bar_label_format" );
+ LightApp_Preferences::String, "VISU", "scalar_bar_label_format" );
// group: "Orientation"
int orientGr = addPreference( tr( "VISU_ORIENTATION" ), sbarTab );
// TAB: "Sweep, Animation"
int srangeTab = addPreference( tr( "Sweep, Animation" ) );
-
+
// group: "Sweeping preferences"
int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
setPreferenceProperty( sweepGr, "columns", 1 );
-
+
int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
QStringList sweep_modes;
sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
setPreferenceProperty( timestep, "step", 0.1 );
setPreferenceProperty( timestep, "max", 1000 );
setPreferenceProperty( nbcycles, "max", 100 );
- setPreferenceProperty( nbsteps, "max", 200 );
+ setPreferenceProperty( nbsteps, "max", 200 );
// group: "Animation preferences"
int animationGr = addPreference( tr( "Animation preferences" ), srangeTab );
addPreference( tr( "Cycled animation" ), animationGr, LightApp_Preferences::Bool, "VISU", "cycled_animation" );
addPreference( tr( "Use proportional timing" ), animationGr, LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
addPreference( tr( "Clean memory at each frame" ), animationGr, LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
-
+
setPreferenceProperty( speed, "min", 1 );
setPreferenceProperty( speed, "max", 99 );
// TAB: Representation ; group: "Representation properties"
int representationTab = addPreference( tr( "Representation" ) );
-
+
int representGr = addPreference( tr( "VISU_REPRESENT_PROPS" ), representationTab );
-
+
QStringList mesh_modes;
mesh_modes.append( "Points" );
mesh_modes.append( "Wireframe" );
mesh_indices.append( 3 );
mesh_indices.append( 4 );
mesh_indices.append( 2 );
-
+
QStringList modes1 = mesh_modes;
modes1.remove( "Insideframe" );
QValueList<QVariant> indices1 = mesh_indices;
indices1.remove( 3 );
-
+
QStringList modes2 = modes1;
modes2.remove( "Surfaceframe" );
QValueList<QVariant> indices2 = indices1;
modes3.remove( "Surface" );
QValueList<QVariant> indices3 = indices2;
indices3.remove( 2 );
-
-
+
+
int mesh_represent = addPreference( tr( "VISU_MESH" ), representGr, LightApp_Preferences::Selector, "VISU", "mesh_represent" );
setPreferenceProperty( mesh_represent, "strings", mesh_modes );
setPreferenceProperty( mesh_represent, "indexes", mesh_indices );
addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" );
int point_precision = addPreference( tr( "VISU_FLOATING_POINT_PRECISION" ), representGr,
- LightApp_Preferences::IntSpin, "VISU", "floating_point_precision" );
+ LightApp_Preferences::IntSpin, "VISU", "floating_point_precision" );
setPreferenceProperty( point_precision, "min", 1 );
setPreferenceProperty( point_precision, "max", 16 );
setPreferenceProperty( point_precision, "step", 1 );
addPreference( "", representGr, LightApp_Preferences::Space );
-
+
addPreference( tr( "VISU_USE_SHADING" ), representGr,
LightApp_Preferences::Bool, "VISU", "represent_shading" );
addPreference( "", representGr, LightApp_Preferences::Space );
// TAB: 3D Cache ; group: "Cache properties"
int cacheTab = addPreference( tr( "3D Cache" ) );
-
+
int cacheGr = addPreference( tr( "VISU_3DCACHE_PROPS" ), cacheTab );
setPreferenceProperty( cacheGr, "columns", 1 );
int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGr,
- LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
+ LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
modes.clear();
modes.append( tr( "VISU_MINIMAL" ) );
indices.clear();
indices.append( 0 );
- indices.append( 1 );
+ indices.append( 1 );
setPreferenceProperty( memory_mode, "indexes", indices );
int memory_limit = addPreference( tr( "VISU_MEMORY_LIMIT" ), cacheGr,
- LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
+ LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
setPreferenceProperty( memory_limit, "min", 1 );
setPreferenceProperty( memory_limit, "max", 5000 );
setPreferenceProperty( memory_limit, "step", 10 );
if (aWarning.size() != 0){
aWarning += "The default values are applied instead.";
SUIT_MessageBox::warn1(GetDesktop(this),
- tr("ERR_SCALARBAR_PARAMS"),
- tr(aWarning.c_str()),
- tr("BUT_OK") );
+ tr("ERR_SCALARBAR_PARAMS"),
+ tr(aWarning.c_str()),
+ tr("BUT_OK") );
}
}
SUIT_ViewManager*
VisuGUI
::getViewManager(const QString& theType,
- const bool theIsCreate)
+ const bool theIsCreate)
{
return getApp()->getViewManager(theType,theIsCreate);
}
{
if( !myDisplayer )
myDisplayer = new VisuGUI_Displayer( getApp() );
-
+
return myDisplayer;
}
if (!anIO.IsNull() && anIO->hasEntry()) {
aSObject = aCStudy->FindObjectID(anIO->getEntry());
if ( !aSObject )
- continue;
+ continue;
VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
if (aPrsObject->GetType() == VISU::TCUTPLANES) {
- aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
- if (aCutPrs)
- break;
+ aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
+ if (aCutPrs)
+ break;
}
}
}
Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aTimeStampSObj);
VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aRestoringMap );
if (aType != TTIMESTAMP )
- return;
-
+ return;
+
QString aMeshName = aRestoringMap["myMeshName"];
QString anEntity = aRestoringMap["myEntityId"];
QString aFieldName = aRestoringMap["myFieldName"];
int aPos;
SUIT_ViewWindow* aViewWindow = 0;
if (anIsVVTK) {
- aViewWindow = GetViewWindow<VVTK_Viewer>(this);
- aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
+ aViewWindow = GetViewWindow<VVTK_Viewer>(this);
+ aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
} else {
- aViewWindow = GetViewWindow<SVTK_Viewer>(this);
- aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
+ aViewWindow = GetViewWindow<SVTK_Viewer>(this);
+ aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
}
GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
-
- VISU::Plot3D_i* aPrs3d =
- CreatePrs3dFromFactory<VISU::Plot3D_i>(this,
- aTimeStampSObj,
- aMeshName.latin1(),
- (Entity)anEntity.toInt(),
- aFieldName.latin1(),
- aTimeStampId.toInt(),
- ColoredPrs3d_i::EPublishUnderTimeStamp);
+
+ VISU::Plot3D_i* aPrs3d =
+ CreatePrs3dFromFactory<VISU::Plot3D_i>(this,
+ aTimeStampSObj,
+ aMeshName.latin1(),
+ (Entity)anEntity.toInt(),
+ aFieldName.latin1(),
+ aTimeStampId.toInt(),
+ ColoredPrs3d_i::EPublishUnderTimeStamp);
if (aPrs3d) {
- SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
- int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
- if (!aValue) {
- VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg(this);
- aDlg->initFromPrsObject(aPrs3d, true);
- int aOrient = aCutPrs->GetOrientationType(); // Plot3d has the same orientation type
- double aRotX = aCutPrs->GetRotateX();
- double aRotY = aCutPrs->GetRotateY();
- double aPlanePos = aCutPrs->GetPlanePosition(0);
- aDlg->setPlane(aOrient, aRotX, aRotY, aPlanePos);
-
- if (!(runAndWait(aDlg, 0) && (aDlg->storeToPrsObject(aPrs3d)))) {
- DeletePrs3d(this, aPrs3d);
- delete aDlg;
- return;
- }
- delete aDlg;
- UpdateObjBrowser(this, true, aTimeStampSObj);
- }
- SVTK_ViewWindow* aSVtkWindow = dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
- if ( aSVtkWindow ) {
- PublishInView(this, aPrs3d, aSVtkWindow, /*highlight = */true);
- aSVtkWindow->onFitAll();
-
- AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
- }
+ SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
+ int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
+ if (!aValue) {
+ VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg(this);
+ aDlg->initFromPrsObject(aPrs3d, true);
+ int aOrient = aCutPrs->GetOrientationType(); // Plot3d has the same orientation type
+ double aRotX = aCutPrs->GetRotateX();
+ double aRotY = aCutPrs->GetRotateY();
+ double aPlanePos = aCutPrs->GetPlanePosition(0);
+ aDlg->setPlane(aOrient, aRotX, aRotY, aPlanePos);
+
+ if (!(runAndWait(aDlg, 0) && (aDlg->storeToPrsObject(aPrs3d)))) {
+ DeletePrs3d(this, aPrs3d);
+ delete aDlg;
+ return;
+ }
+ delete aDlg;
+ UpdateObjBrowser(this, true, aTimeStampSObj);
+ }
+ SVTK_ViewWindow* aSVtkWindow = dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
+ if ( aSVtkWindow ) {
+ PublishInView(this, aPrs3d, aSVtkWindow, /*highlight = */true);
+ aSVtkWindow->onFitAll();
+
+ AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
+ }
}
}
application()->putInfo(QObject::tr("INF_DONE"));
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
VISU::Result_var aResult = FindResult( VISU::GetSObject( aSObject ).in() );
if(CORBA::is_nil(aResult.in()))
continue;
-
+
VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>(VISU::GetServant(aResult).in());
if(!aCResult)
continue;
QString aMeshName = Storable::FindValue(aRestoringMap, "myMeshName", &anIsFound);
if(!anIsFound)
continue;
-
+
std::string aPartName = aSObject->GetName();
aCResult->SetResolution(aMeshName.latin1(), aPartName.c_str(), theResolution);
// File : VisuGUI_GaussPointsDlg.cxx
// Author : Oleg UVAROV
// Module : VISU
-//
+
#include "VisuGUI_GaussPointsDlg.h"
#include "VISUConfig.hh"
RBImposedRange = new QRadioButton (tr("IMPOSED_RANGE_BTN"), RangeGroup, "RBImposedRange");
RBFieldRange->setChecked( true );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
+
+ QDoubleValidator* dv = new QDoubleValidator(this);
+ dv->setDecimals(aPrecision);
+
MinEdit = new QLineEdit( RangeGroup, "MinEdit" );
MinEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
MinEdit->setMinimumWidth( 70 );
- MinEdit->setValidator( new QDoubleValidator(this) );
+ MinEdit->setValidator( dv );
MinEdit->setText( "0.0" );
QLabel* MinLabel = new QLabel (tr("LBL_MIN"), RangeGroup, "MinLabel");
MinLabel->setBuddy(MinEdit);
MaxEdit = new QLineEdit( RangeGroup, "MaxEdit" );
MaxEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
MaxEdit->setMinimumWidth( 70 );
- MaxEdit->setValidator( new QDoubleValidator(this) );
+ MaxEdit->setValidator( dv );
MaxEdit->setText( "0.0" );
QLabel* MaxLabel = new QLabel (tr("LBL_MAX"), RangeGroup, "MaxLabel");
MaxLabel->setBuddy(MaxEdit);
MinEdit->setEnabled( false );
MaxEdit->setEnabled( false );
- MinEdit->setText( QString::number( myPrsCopy->GetMin() ) );
- MaxEdit->setText( QString::number( myPrsCopy->GetMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0);
+
+ MinEdit->setText( QString::number( myPrsCopy->GetMin(), 'g', aPrecision ) );
+ MaxEdit->setText( QString::number( myPrsCopy->GetMax(), 'g', aPrecision ) );
}
MinEdit->setEnabled( RBImposedRange->isChecked() );
MaxEdit->setEnabled( RBImposedRange->isChecked() );
- MinEdit->setText( QString::number( myPrsCopy->GetMin() ) );
- MaxEdit->setText( QString::number( myPrsCopy->GetMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0);
+
+ MinEdit->setText( QString::number( myPrsCopy->GetMin(), 'g', aPrecision ) );
+ MaxEdit->setText( QString::number( myPrsCopy->GetMax(), 'g', aPrecision ) );
}
MinEdit->setEnabled( false );
MaxEdit->setEnabled( false );
- MinEdit->setText( QString::number( myPrsCopy->GetMin() ) );
- MaxEdit->setText( QString::number( myPrsCopy->GetMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0);
+
+ MinEdit->setText( QString::number( myPrsCopy->GetMin(), 'g', aPrecision ) );
+ MaxEdit->setText( QString::number( myPrsCopy->GetMax(), 'g', aPrecision ) );
}
{
myPrsCopy->SetScalarMode( theMode );
if ( UseFieldRange() ) {
- MinEdit->setText( QString::number( myPrsCopy->GetSourceMin() ) );
- MaxEdit->setText( QString::number( myPrsCopy->GetSourceMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0);
+
+ MinEdit->setText( QString::number( myPrsCopy->GetSourceMin(), 'g', aPrecision ) );
+ MaxEdit->setText( QString::number( myPrsCopy->GetSourceMax(), 'g', aPrecision ) );
}
}
* Initialise dialog box from presentation object
*/
void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs,
- bool theInit )
+ bool theInit )
{
myPrsCopy = thePrs;
MaxEdit->setEnabled( false );
}
- MinEdit->setText( QString::number( thePrs->GetMin() ) );
- MaxEdit->setText( QString::number( thePrs->GetMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0);
+
+ MinEdit->setText( QString::number( thePrs->GetMin(), 'g', aPrecision ) );
+ MaxEdit->setText( QString::number( thePrs->GetMax(), 'g', aPrecision ) );
setPosAndSize( thePrs->GetPosX(),
- thePrs->GetPosY(),
- thePrs->GetWidth(),
- thePrs->GetHeight(),
- thePrs->GetBarOrientation());
+ thePrs->GetPosY(),
+ thePrs->GetWidth(),
+ thePrs->GetHeight(),
+ thePrs->GetBarOrientation());
if(RBvert->isChecked()) {
myVerTW = thePrs->GetTitleWidth();
QString anUnit = QString(aUnitNames[i].c_str()).simplifyWhiteSpace();
if(anUnit.isNull() || anUnit == "")
anUnit = "-";
-
+
aComponent = aComponent + ", " + anUnit;
myModeCombo->insertItem(aComponent);
thePrs->SetShadowTitle(isTitleShadow);
thePrs->SetTitFontType(aTitleFontFamily);
thePrs->SetTitleColor(aTitColor.red()/255.,
- aTitColor.green()/255.,
- aTitColor.blue()/255.);
+ aTitColor.green()/255.,
+ aTitColor.blue()/255.);
// "Label"
QColor aLblColor (255, 255, 255);
thePrs->SetShadowLabel(isLabelShadow);
thePrs->SetLblFontType(aLabelFontFamily);
thePrs->SetLabelColor(aLblColor.red()/255.,
- aLblColor.green()/255.,
- aLblColor.blue()/255.);
+ aLblColor.green()/255.,
+ aLblColor.blue()/255.);
}
return 1;
{}
void VisuGUI_GaussPointsDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TGAUSSPOINTS>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
aMainTexture = aMainTexture.isNull() ? myPrsCopy->GetQMainTexture() : aMainTexture;
anAlphaTexture = anAlphaTexture.isNull() ? myPrsCopy->GetQAlphaTexture() : anAlphaTexture;
-
+
myPrsCopy->SetTextures( aMainTexture, anAlphaTexture );
myPrsCopy->SetAlphaThreshold( myPrimitiveBox->getAlphaThreshold() );
myPrsCopy->SetMagnification( mySizeBox->getMagnification() );
myPrsCopy->SetMagnificationIncrement( mySizeBox->getIncrement() );
- VISU::TSameAsFactory<VISU::TGAUSSPOINTS>().Copy(myPrsCopy, thePrs);
-
+ VISU::TSameAsFactory<VISU::TGAUSSPOINTS>().Copy(myPrsCopy, thePrs);
+
//Set created Gauss points presentation selected,
//Issue 0019874(EDF 746 VISU: Picking alphanumeric Gauss)
if(thePrs){
aWarning.append( "presentation might be too important to ensure an acceptable frame rate.\n\n" );
aWarning.append( "Can you please confirm that you want to continue anyway?" );
if( SUIT_MessageBox::warn2( this, tr( "Warning" ), aWarning, tr( "&OK" ), tr( "&Cancel" ), 0, 1, 1 ) == 1 )
- return;
+ return;
}
/*
// File : VisuGUI_Prs3dDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
// Module : VISU
-//
+
#include "VisuGUI_Prs3dDlg.h"
#include "VisuGUI.h"
}
else {
SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
- QObject::tr("BUT_OK"));
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
QVBoxLayout* TopLayout = new QVBoxLayout(this);
TopLayout->setSpacing(6);
TopLayout->setMargin(11);
-
+
QGroupBox* WidthHeightGroup = new QGroupBox (tr(""), this, "WidthHeightGroup");
WidthHeightGroup->setColumnLayout(0, Qt::Vertical );
WidthHeightGroup->layout()->setSpacing( 0 );
//----------------------------------------------------------------------------
void VisuGUI_BarPrefDlg::setRatios(int titleRatioWidth, int titleRatioHeight,
- int labelRatioWidth, int labelRatioHeight,
- int barRatioWidth, int barRatioHeight)
+ int labelRatioWidth, int labelRatioHeight,
+ int barRatioWidth, int barRatioHeight)
{
TitleWidthSpin->setValue( myTitleWidth=titleRatioWidth );
TitleHeightSpin->setValue( myTitleHeight=titleRatioHeight );
//----------------------------------------------------------------------------
void VisuGUI_BarPrefDlg::getRatios(int& titleRatioWidth, int& titleRatioHeight,
- int& labelRatioWidth, int& labelRatioHeight,
- int& barRatioWidth, int& barRatioHeight)
+ int& labelRatioWidth, int& labelRatioHeight,
+ int& barRatioWidth, int& barRatioHeight)
{
titleRatioWidth=TitleWidthSpin->value();
titleRatioHeight=TitleHeightSpin->value();
}
else {
SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
- QObject::tr("BUT_OK"));
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
dVal.sprintf(UnitsEdit->text(),1.1);
if(dVal.toDouble() == 0.) {
SUIT_MessageBox::warn1( this,tr("WRN_VISU"),
- tr("MSG_LABEL_FORMAT"),
- tr("BUT_OK"));
+ tr("MSG_LABEL_FORMAT"),
+ tr("BUT_OK"));
} else {
if(
(
- TitleWidthSpin->value()+
- LabelWidthSpin->value()+
- BarWidthSpin->value()
- > 100
- ) ||
+ TitleWidthSpin->value()+
+ LabelWidthSpin->value()+
+ BarWidthSpin->value()
+ > 100
+ ) ||
(
- TitleHeightSpin->value()+
- LabelHeightSpin->value()+
- BarHeightSpin->value()
- > 100
+ TitleHeightSpin->value()+
+ LabelHeightSpin->value()+
+ BarHeightSpin->value()
+ > 100
)
) {
SUIT_MessageBox::warn1( this,tr("WRN_VISU"),
- tr("MSG_BIG_SCALE"),
- tr("BUT_OK"));
+ tr("MSG_BIG_SCALE"),
+ tr("BUT_OK"));
} else {
myTitleWidth = TitleWidthSpin->value();
myTitleHeight = TitleHeightSpin->value();
RBIrange = new QRadioButton (tr("IMPOSED_RANGE_BTN"), RangeGroup, "RBIrange");
RBFrange->setChecked( true );
+ int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
+ QDoubleValidator* dv = new QDoubleValidator(this);
+ dv->setDecimals(aPrecision);
+
MinEdit = new QLineEdit( RangeGroup, "MinEdit" );
MinEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
MinEdit->setMinimumWidth( 70 );
- MinEdit->setValidator( new QDoubleValidator(this) );
+ MinEdit->setValidator( dv );
MinEdit->setText( "0.0" );
QLabel* MinLabel = new QLabel (tr("LBL_MIN"), RangeGroup, "MinLabel");
MinLabel->setBuddy(MinEdit);
MaxEdit = new QLineEdit( RangeGroup, "MaxEdit" );
MaxEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
MaxEdit->setMinimumWidth( 70 );
- MaxEdit->setValidator( new QDoubleValidator(this) );
+ MaxEdit->setValidator( dv );
MaxEdit->setText( "0.0" );
QLabel* MaxLabel = new QLabel (tr("LBL_MAX"), RangeGroup, "MaxLabel");
MaxLabel->setBuddy(MaxEdit);
}
else
aResourceMgr->setValue("VISU", "scalar_range_type", 0);
-
+
aResourceMgr->setValue("VISU", "scalar_bar_logarithmic", isLogarithmic());
-
+
////
if (myIsStoreTextProp) {
isTitleBold, isTitleItalic, isTitleShadow);
QFont aTitleFont;
-
+
aTitleFont.setBold(isTitleBold);
aTitleFont.setItalic(isTitleItalic);
aTitleFont.setUnderline(isTitleShadow);
-
+
QString titleFontFamily;
switch (aTitleFontFamily) {
case VTK_ARIAL:
break;
}
aTitleFont.setFamily(titleFontFamily);
-
+
aResourceMgr->setValue("VISU", "scalar_bar_title_font", aTitleFont);
-
+
aResourceMgr->setValue("VISU", "scalar_bar_title_color", aTitleColor);
-
+
// "Label"
QColor aLabelColor (255, 255, 255);
int aLabelFontFamily = VTK_ARIAL;
QFont aLabelFont;
-
+
aLabelFont.setBold(isLabelBold);
aLabelFont.setItalic(isLabelItalic);
aLabelFont.setUnderline(isLabelShadow);
}
aLabelFont.setFamily(labelFontFamily);
-
+
aResourceMgr->setValue("VISU", "scalar_bar_label_font", aLabelFont);
aResourceMgr->setValue("VISU", "scalar_bar_label_color", aLabelColor);
void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs)
{
myScalarMap = dynamic_cast<VISU::ScalarMap_i*>(thePrs);
-
+
if( !myScalarMap )
return;
QString anUnit = QString(aUnitNames[i].c_str()).simplifyWhiteSpace();
if(anUnit.isNull() || anUnit == "")
anUnit = "-";
-
+
aComponent = aComponent + ", " + anUnit;
myModeCombo->insertItem(aComponent);
myTitle = aTitle.in();
setPosAndSize( myScalarMap->GetPosX(),
- myScalarMap->GetPosY(),
- myScalarMap->GetWidth(),
- myScalarMap->GetHeight(),
- myScalarMap->GetBarOrientation());
+ myScalarMap->GetPosY(),
+ myScalarMap->GetWidth(),
+ myScalarMap->GetHeight(),
+ myScalarMap->GetBarOrientation());
if(RBvert->isChecked()) {
myVerTW = myScalarMap->GetTitleWidth();
myScalarMapPL = VISU_ScalarMapPL::New();
if(myScalarMap->GetSpecificPL())
myScalarMapPL->ShallowCopy(myScalarMap->GetSpecificPL(), true);
-
+
if ( myBusy ) return;
myBusy = true;
VISU_ScalarBarActor* aScalarBarActor = myPreviewActor->GetScalarBar();
myPreviewActor->GetScalarBar()->VisibilityOn();
myPreviewActor->PickableOff();
-
+
myScalarMapPL->SetScalarMode(myModeCombo->currentItem());
if(isLogarithmic())
myScalarMapPL->SetScaling(VISU::LOGARITHMIC);
}
myScalarMapPL->SetScalarRange(theRange);
myScalarMapPL->SetNbColors(sbCol);
-
+
myScalarMapPL->Update();
-
+
aScalarBarActor->SetLookupTable(myScalarMapPL->GetBarTable());
-
+
if (myTextDlg->getTitleText().latin1() != "") {
VISU::PValForTime aValForTime;
const VISU::PField& aField = myScalarMap->GetScalarField();
std::strstream aStream;
const VISU::TTime& aTime = aValForTime->myTime;
aStream<< myTextDlg->getTitleText() <<" ";
- if(myBarDlg->isUnitsVisible())
- aStream<<VISU_Convertor::GenerateName(aTime)<<std::ends;
+ if(myBarDlg->isUnitsVisible())
+ aStream<<VISU_Convertor::GenerateName(aTime)<<std::ends;
else {
- QString aName;
- aName.sprintf("%g", aTime.first);
- aStream << aName << std::ends;
+ QString aName;
+ aName.sprintf("%g", aTime.first);
+ aStream << aName << std::ends;
}
std::string aScalarBarTitle = aStream.str();
aScalarBarActor->SetTitle(aScalarBarTitle.c_str());
bool isTitleItalic;
bool isTitleShadow;
myTextDlg->myTitleFont->GetData(aTitleColor,aTitleFontFamily,
- isTitleBold,isTitleItalic,isTitleShadow);
+ isTitleBold,isTitleItalic,isTitleShadow);
vtkTextProperty* aTitleProp = aScalarBarActor->GetTitleTextProperty();
aTitleProp->SetFontFamily(aTitleFontFamily);
aTitleProp->SetColor(vtkFloatingPointType(aTitleColor.red())/255.,
- vtkFloatingPointType(aTitleColor.green())/255.,
- vtkFloatingPointType(aTitleColor.blue())/255.);
+ vtkFloatingPointType(aTitleColor.green())/255.,
+ vtkFloatingPointType(aTitleColor.blue())/255.);
(isTitleBold)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
(isTitleItalic)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
(isTitleShadow)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
-
+
// label text property
QColor aLabelColor;
int aLabelFontFamily;
bool isLabelItalic;
bool isLabelShadow;
myTextDlg->myLabelFont->GetData(aLabelColor, aLabelFontFamily,
- isLabelBold, isLabelItalic, isLabelShadow);
+ isLabelBold, isLabelItalic, isLabelShadow);
vtkTextProperty* aLabelProp = aScalarBarActor->GetLabelTextProperty();
aLabelProp->SetFontFamily(aLabelFontFamily);
aLabelProp->SetColor(vtkFloatingPointType(aLabelColor.red())/255.,
- vtkFloatingPointType(aLabelColor.green())/255.,
- vtkFloatingPointType(aLabelColor.blue())/255.);
+ vtkFloatingPointType(aLabelColor.green())/255.,
+ vtkFloatingPointType(aLabelColor.blue())/255.);
(isLabelBold)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
(isLabelItalic)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
(isLabelShadow)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
void VisuGUI_ScalarBarPane::deleteScalarBar()
{
if ( myBusy ) return;
-
+
if (myPreviewActor == 0) return;
vtkRenderer* aRend = myPreviewActor->GetRenderer();
vtkRenderWindow* aWnd = aRend->GetRenderWindow();
myScalarMap->SetShadowTitle(isTitleShadow);
myScalarMap->SetTitFontType(aTitleFontFamily);
myScalarMap->SetTitleColor(aTitColor.red()/255.,
- aTitColor.green()/255.,
- aTitColor.blue()/255.);
+ aTitColor.green()/255.,
+ aTitColor.blue()/255.);
// "Label"
QColor aLblColor (255, 255, 255);
myScalarMap->SetShadowLabel(isLabelShadow);
myScalarMap->SetLblFontType(aLabelFontFamily);
myScalarMap->SetLabelColor(aLblColor.red()/255.,
- aLblColor.green()/255.,
- aLblColor.blue()/255.);
+ aLblColor.green()/255.,
+ aLblColor.blue()/255.);
myIsStoreTextProp = false;
}
myScalarMap->SetScalarMode(theMode);
if ( RBFrange->isChecked() ) {
- MinEdit->setText( QString::number( myScalarMap->GetSourceMin() ) );
- MaxEdit->setText( QString::number( myScalarMap->GetSourceMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0);
+
+ MinEdit->setText( QString::number( myScalarMap->GetSourceMin(), 'g', aPrecision ) );
+ MaxEdit->setText( QString::number( myScalarMap->GetSourceMax(), 'g', aPrecision ) );
}
updatePreview();
*/
void VisuGUI_ScalarBarPane::setRange( double imin, double imax, bool sbRange )
{
- MinEdit->setText( QString::number( imin ) );
- MaxEdit->setText( QString::number( imax ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0);
+
+ MinEdit->setText( QString::number( imin, 'g', aPrecision ) );
+ MaxEdit->setText( QString::number( imax, 'g', aPrecision ) );
if( sbRange )
RBIrange->setChecked( true );
if ( RBIrange->isChecked() ) {
if (minVal >= maxVal) {
SUIT_MessageBox::warn1( this,tr("WRN_VISU"),
- tr("MSG_MINMAX_VALUES"),
- tr("BUT_OK"));
+ tr("MSG_MINMAX_VALUES"),
+ tr("BUT_OK"));
return false;
}
}
if ( CBLog->isChecked() ) {
if ( minVal <= 0.0 || maxVal <= 0.0 ) {
if ( RBIrange->isChecked() ) {
- SUIT_MessageBox::warn1( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_RANGE"),
- tr("BUT_OK"));
+ SUIT_MessageBox::warn1( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_RANGE"),
+ tr("BUT_OK"));
} else {
- if ( minVal == 0 || maxVal == 0)
- SUIT_MessageBox::warn1( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_RANGE"),
- tr("BUT_OK"));
- else
- SUIT_MessageBox::warn1( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_FIELD_RANGE"),
- tr("BUT_OK"));
- RBIrange->setChecked(true);
- changeRange(1);
+ if ( minVal == 0 || maxVal == 0)
+ SUIT_MessageBox::warn1( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_RANGE"),
+ tr("BUT_OK"));
+ else
+ SUIT_MessageBox::warn1( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_FIELD_RANGE"),
+ tr("BUT_OK"));
+ RBIrange->setChecked(true);
+ changeRange(1);
}
return false;
}
//----------------------------------------------------------------------------
VisuGUI_Prs3dDlg::VisuGUI_Prs3dDlg( SalomeApp_Module* theModule ) :
QDialog( VISU::GetDesktop( theModule ), 0, false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
{}
}
else {
SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
- QObject::tr("BUT_OK"));
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
-
+
if ( e->key() == Key_F1 ) {
e->accept();
onHelp();
//----------------------------------------------------------------------------
void VisuGUI_ScalarBarBaseDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
myScalarPane->initFromPrsObject( thePrs );
}