myAddToStudy = true;
myPipeLine = NULL;
CORBA::String_var aName = myStudy->Name();
- MESSAGE("Prs3d_i - this = "<<this<<"; StudyId = "<<myStudy->StudyId()<<"; Name = '"<<aName.in()<<"'");
+ if(MYDEBUG) MESSAGE("Prs3d_i - this = "<<this<<"; StudyId = "<<myStudy->StudyId()<<"; Name = '"<<aName.in()<<"'");
}
void VISU::Prs3d_i::SameAs(const Prs3d_i* theOrigin)
}
VISU::Prs3d_i::~Prs3d_i() {
- MESSAGE("~Prs3d_i() - this = "<<this<<"; GetReferenceCount() = "<<myPipeLine->GetReferenceCount());
+ if(MYDEBUG) MESSAGE("~Prs3d_i() - this = "<<this<<"; GetReferenceCount() = "<<myPipeLine->GetReferenceCount());
myPipeLine->Delete();
myResult->Destroy();
}
}
void VISU::Prs3d_i::UpdateActor(VISU_Actor* theActor) {
+ if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor() - this = "<<this);
theActor->GetMapper()->ShallowCopy(myPipeLine->GetMapper());
theActor->Modified();
}
}
void VISU::Prs3d_i::Update() {
+ if(MYDEBUG) MESSAGE("Prs3d_i::Update() - this = "<<this);
try{
myPipeLine->Update();
}catch(...){
using namespace std;
#ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
#endif
import os
import time
+import math
import VISU
import SALOMEDS
from batchmode_visu import *
-aDelay = 1
+aDelay = 0
#mySession = batchmode_visu.mySession
-medFile = "fra.med"
-myFieldName = "VITESSE";
-
-medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile
-myResult = myVisu.ImportFile(medFile)
-
-
-aMeshName ="LE VOLUME"
-anEntity = VISU.NODE
-aMesh = myVisu.MeshOnEntity(myResult, aMeshName, anEntity)
-
-aTimeStampId = 1
-
-aScalarMap = myVisu.ScalarMapOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
-
-aCutPlanes = myVisu.CutPlanesOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
-
-aIsoSurfaces = myVisu.IsoSurfacesOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId)
-
myViewManager = myVisu.GetViewManager();
-#myView = myViewManager.GetCurrentView();
myView = myViewManager.Create3DView();
myView.SetTitle("The window will be soon destroyed!")
print "myViewManager.Create3DView()"
print "myViewManager.Destroy(myView)"
time.sleep(aDelay)
+
+
+medFile = "fra.med"
+myFieldName = "VITESSE";
+
+aMeshName ="LE VOLUME"
+anEntity = VISU.NODE
+aTimeStampId = 1
+
+medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile
+myResult = myVisu.ImportFile(medFile)
+
+
+
myView = myViewManager.Create3DView();
-myView.SetTitle("The window will be set to 'AAA' view params")
+
+print "myView.SetBackground(...)"
+aColor = SALOMEDS.Color(0.0,0.3,1.0)
+myView.SetBackground(aColor);
+
+myView.SetTitle("The viewer will display ScalarMap")
print "myViewManager.Create3DView()"
-time.sleep(aDelay)
+
+aScalarMap = myVisu.ScalarMapOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
myView.Display(aScalarMap);
print "myView.Display(aScalarMap)"
myView.SetFocalPoint([0,0,0]);
print "myView.SetFocalPoint(...)"
-time.sleep(aDelay)
myView.SetParallelScale(2);
print "myView.SetParallelScale(...)"
-time.sleep(aDelay)
+myView.FitAll();
+
+aMax = aScalarMap.GetMax()
+aMin = aScalarMap.GetMin()
+aDelta = (aMax - aMin)/2.0
+aNbColors = aScalarMap.GetNbColors()
+aNbColors = 64
+for i in range(2,aNbColors) :
+ aScalarMap.SetNbColors(i)
+ aX = aMin + aDelta*i/aNbColors
+ aY = aMax - aDelta*i/aNbColors
+ aScalarMap.SetRange(aX,aY)
+ myView.Update();
+ time.sleep(aDelay)
+
+aScalarMap.SetRange(aMin,aMax)
+
+print "myView.Update()"
+myView.Update();
+print "myView.FitAll()"
+myView.FitAll();
+
+
+
+myView = myViewManager.Create3DView();
+myView.SetTitle("Here we will display CutPlanes")
+
+print "myView.SetBackground(...)"
+aColor = SALOMEDS.Color(0.0,0.7,0.0)
+myView.SetBackground(aColor);
+
+aCutPlanes = myVisu.CutPlanesOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
+print "myVisu.CutPlanesOnField(...)"
+
+myView.DisplayOnly(aCutPlanes);
+print "myView.DisplayOnly(aCutPlanes)"
aPoint = myView.GetPointOfView();
aPoint[0] = aPoint[0] + 10;
print "myView.ScaleView(...)"
time.sleep(aDelay)
-aColor = SALOMEDS.Color(0.0,0.3,1.0)
-myView.SetBackground(aColor);
-print "myView.SetBackground(...)"
-myView.Update();
-print "myView.Update()"
-time.sleep(aDelay)
-
myView.FitAll();
-print "myView.FitAll()"
-time.sleep(aDelay)
-myView.Erase(aScalarMap);
-print "myView.Erase(aScalarMap)"
-time.sleep(aDelay)
+aNbPlanes = aCutPlanes.GetNbPlanes()
+aNbPlanes = 30
+aXAngle = aCutPlanes.GetRotateX()
+aYAngle = aCutPlanes.GetRotateY()
+anOrientation = aCutPlanes.GetOrientationType()
+for i in range(aNbPlanes,1,-1) :
+ aCutPlanes.SetNbPlanes(i)
+ aX = math.pi/2.0*(aNbPlanes-i)/aNbPlanes
+ aY = math.pi/2.0*(aNbPlanes-i)/aNbPlanes
+ aCutPlanes.SetOrientation(anOrientation,aX,aY)
+ myView.Update();
+ time.sleep(aDelay)
+
+aNbPlanes = 10
+aCutPlanes.SetOrientation(VISU.CutPlanes.ZX,0,0)
+for i in range(1,aNbPlanes) :
+ aCutPlanes.SetNbPlanes(i)
+ myView.Update();
+ time.sleep(aDelay)
-myView.DisplayOnly(aCutPlanes);
-print "myView.DisplayOnly(aCutPlanes)"
myView.SaveViewParams('AAA')
print "myView.SaveViewParams('AAA')"
time.sleep(aDelay)
+aCutPlanes.SetOrientation(VISU.CutPlanes.XY,0,0)
+myView.RemoveScale();
+
+print "myView.Update()"
+myView.Update();
+print "myView.FitAll()"
+myView.FitAll();
+
+
+
myView = myViewManager.Create3DView();
-myView.SetTitle("The window will be set to 'BBB' view params")
print "myViewManager.Create3DView()"
+
+myView.SetTitle("IsoSurface's viewer")
+
+print "myView.SetBackground(...)"
+aColor = SALOMEDS.Color(1.0,0.7,0.0)
+myView.SetBackground(aColor);
time.sleep(aDelay)
+aIsoSurfaces = myVisu.IsoSurfacesOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId)
+
myView.DisplayOnly(aIsoSurfaces);
+myView.FitAll();
print "myView.DisplayOnly(aCutPlanes)"
time.sleep(aDelay)
-myView.RestoreViewParams('AAA')
-myView.RemoveScale();
-print "myView.RemoveScale()"
+aNbSurfaces = aIsoSurfaces.GetNbSurfaces()
+aNbSurfaces = 64
+for i in range(2,aNbSurfaces) :
+ aIsoSurfaces.SetNbSurfaces(i)
+ myView.Update();
+ time.sleep(aDelay)
+
+aIsoSurfaces.SetNbSurfaces(10)
+
+print "myView.Update()"
+myView.Update();
+print "myView.FitAll()"
+myView.FitAll();
+
+
+
+myView = myViewManager.Create3DView();
+myView.SetTitle("The viewer for CutLines")
+print "myViewManager.Create3DView()"
time.sleep(aDelay)
-aColor = SALOMEDS.Color(0.0,0.0,0.0)
-myView.SetBackground(aColor);
print "myView.SetBackground(...)"
-myView.SaveViewParams('BBB');
-print "myView.SaveViewParams('BBB')"
+aColor = SALOMEDS.Color(0.7,0.7,0.7)
+myView.SetBackground(aColor);
time.sleep(aDelay)
-aColor = SALOMEDS.Color(1.0,1.0,1.0)
-myView.SetBackground(aColor);
-print "myView.SetBackground(...)"
+aCutLines = myVisu.CutLinesOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId)
+aCutLines.SetOrientation(VISU.CutPlanes.ZX,0,0)
+aCutLines.SetOrientation2(VISU.CutPlanes.YZ,0,0)
+
+myView.DisplayOnly(aCutLines);
+myView.FitAll();
+print "myView.DisplayOnly(aCutLines)"
time.sleep(aDelay)
-myView.ScaleView(VISU.View3D.ZAxis,0.5);
-print "myView.SetBackground(...)"
-myView.SaveViewParams('CCC');
-print "myView.SaveViewParams('CCC')"
+aSObj = myStudy.FindObjectIOR(aCutLines.GetID())
+aTable = myVisu.CreateTable( aSObj.GetID() )
+print "myVisu.CreateTable(...)"
+
+aTableView = myViewManager.CreateTableView(aTable)
+aTableView.SetTitle('Changed Title')
+
+aContainer = myVisu.CreateContainer()
+print "myVisu.CreateContainer(...)"
+
+aNbCurve = aTable.GetNbRows() - 1
+for i in range(2,aNbCurve):
+ aCurve = myVisu.CreateCurve( aTable, 1, i )
+ print i, aCurve
+ aContainer.AddCurve(aCurve)
+
+
+myView = myViewManager.CreateXYPlot();
+myView.SetTitle("The viewer for Curves from CutLines")
+print "myViewManager.CreateXYPlot()"
time.sleep(aDelay)
-myView.RestoreViewParams('BBB');
-print "myView.RestoreViewParams('BBB')"
+myView.Display(aContainer)
+
+
+
+myView = myViewManager.Create3DView();
+myView.SetTitle("The viewer for Animation")
+print "myViewManager.Create3DView()"
+time.sleep(aDelay)
-# Time animation
-myView.EraseAll()
medFile = "TimeStamps.med"
myFieldName = "vitesse";
print "Generate frames"
anAnim.generateFrames()
print "Start Animation"
-anAnim.setSpeed(12)
-#anAnim.setCycling(1)
+anAnim.setSpeed(99)
+anAnim.setCycling(1)
anAnim.startAnimation()
myView.FitAll()
-#anAnim.clearView()
import os
import time
+import math
import VISU
import SALOMEDS
from visu_gui import *
-aDelay = 1
+aDelay = 0
#mySession = batchmode_visu.mySession
-medFile = "fra.med"
-myFieldName = "VITESSE";
-
-medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile
-myResult = myVisu.ImportFile(medFile)
-
-
-aMeshName ="LE VOLUME"
-anEntity = VISU.NODE
-aMesh = myVisu.MeshOnEntity(myResult, aMeshName, anEntity)
-
-aTimeStampId = 1
-
-aScalarMap = myVisu.ScalarMapOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
-
-aCutPlanes = myVisu.CutPlanesOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
-
-aIsoSurfaces = myVisu.IsoSurfacesOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId)
-
myViewManager = myVisu.GetViewManager();
-#myView = myViewManager.GetCurrentView();
myView = myViewManager.Create3DView();
myView.SetTitle("The window will be soon destroyed!")
print "myViewManager.Create3DView()"
print "myViewManager.Destroy(myView)"
time.sleep(aDelay)
+
+
+medFile = "fra.med"
+myFieldName = "VITESSE";
+
+aMeshName ="LE VOLUME"
+anEntity = VISU.NODE
+aTimeStampId = 1
+
+medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile
+myResult = myVisu.ImportFile(medFile)
+
+
+
myView = myViewManager.Create3DView();
-myView.SetTitle("The window will be set to 'AAA' view params")
+
+print "myView.SetBackground(...)"
+aColor = SALOMEDS.Color(0.0,0.3,1.0)
+myView.SetBackground(aColor);
+
+myView.SetTitle("The viewer will display ScalarMap")
print "myViewManager.Create3DView()"
-time.sleep(aDelay)
+
+aScalarMap = myVisu.ScalarMapOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
myView.Display(aScalarMap);
print "myView.Display(aScalarMap)"
myView.SetFocalPoint([0,0,0]);
print "myView.SetFocalPoint(...)"
-time.sleep(aDelay)
myView.SetParallelScale(2);
print "myView.SetParallelScale(...)"
-time.sleep(aDelay)
+myView.FitAll();
+
+aMax = aScalarMap.GetMax()
+aMin = aScalarMap.GetMin()
+aDelta = (aMax - aMin)/2.0
+aNbColors = aScalarMap.GetNbColors()
+aNbColors = 64
+for i in range(2,aNbColors) :
+ aScalarMap.SetNbColors(i)
+ aX = aMin + aDelta*i/aNbColors
+ aY = aMax - aDelta*i/aNbColors
+ aScalarMap.SetRange(aX,aY)
+ myView.Update();
+ time.sleep(aDelay)
+
+aScalarMap.SetRange(aMin,aMax)
+
+print "myView.Update()"
+myView.Update();
+print "myView.FitAll()"
+myView.FitAll();
+
+
+
+myView = myViewManager.Create3DView();
+myView.SetTitle("Here we will display CutPlanes")
+
+print "myView.SetBackground(...)"
+aColor = SALOMEDS.Color(0.0,0.7,0.0)
+myView.SetBackground(aColor);
+
+aCutPlanes = myVisu.CutPlanesOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
+print "myVisu.CutPlanesOnField(...)"
+
+myView.DisplayOnly(aCutPlanes);
+print "myView.DisplayOnly(aCutPlanes)"
aPoint = myView.GetPointOfView();
aPoint[0] = aPoint[0] + 10;
print "myView.ScaleView(...)"
time.sleep(aDelay)
-aColor = SALOMEDS.Color(0.0,0.3,1.0)
-myView.SetBackground(aColor);
-print "myView.SetBackground(...)"
-myView.Update();
-print "myView.Update()"
-time.sleep(aDelay)
-
myView.FitAll();
-print "myView.FitAll()"
-time.sleep(aDelay)
-myView.Erase(aScalarMap);
-print "myView.Erase(aScalarMap)"
-time.sleep(aDelay)
+aNbPlanes = aCutPlanes.GetNbPlanes()
+aNbPlanes = 30
+aXAngle = aCutPlanes.GetRotateX()
+aYAngle = aCutPlanes.GetRotateY()
+anOrientation = aCutPlanes.GetOrientationType()
+for i in range(aNbPlanes,1,-1) :
+ aCutPlanes.SetNbPlanes(i)
+ aX = math.pi/2.0*(aNbPlanes-i)/aNbPlanes
+ aY = math.pi/2.0*(aNbPlanes-i)/aNbPlanes
+ aCutPlanes.SetOrientation(anOrientation,aX,aY)
+ myView.Update();
+ time.sleep(aDelay)
+
+aNbPlanes = 10
+aCutPlanes.SetOrientation(VISU.CutPlanes.ZX,0,0)
+for i in range(1,aNbPlanes) :
+ aCutPlanes.SetNbPlanes(i)
+ myView.Update();
+ time.sleep(aDelay)
-myView.DisplayOnly(aCutPlanes);
-print "myView.DisplayOnly(aCutPlanes)"
myView.SaveViewParams('AAA')
print "myView.SaveViewParams('AAA')"
time.sleep(aDelay)
+aCutPlanes.SetOrientation(VISU.CutPlanes.XY,0,0)
+myView.RemoveScale();
+
+print "myView.Update()"
+myView.Update();
+print "myView.FitAll()"
+myView.FitAll();
+
+
+
myView = myViewManager.Create3DView();
-myView.SetTitle("The window will be set to 'BBB' view params")
print "myViewManager.Create3DView()"
+
+myView.SetTitle("IsoSurface's viewer")
+
+print "myView.SetBackground(...)"
+aColor = SALOMEDS.Color(1.0,0.7,0.0)
+myView.SetBackground(aColor);
time.sleep(aDelay)
+aIsoSurfaces = myVisu.IsoSurfacesOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId)
+
myView.DisplayOnly(aIsoSurfaces);
+myView.FitAll();
print "myView.DisplayOnly(aCutPlanes)"
time.sleep(aDelay)
-myView.RestoreViewParams('AAA')
-myView.RemoveScale();
-print "myView.RemoveScale()"
+aNbSurfaces = aIsoSurfaces.GetNbSurfaces()
+aNbSurfaces = 64
+for i in range(2,aNbSurfaces) :
+ aIsoSurfaces.SetNbSurfaces(i)
+ myView.Update();
+ time.sleep(aDelay)
+
+aIsoSurfaces.SetNbSurfaces(10)
+
+print "myView.Update()"
+myView.Update();
+print "myView.FitAll()"
+myView.FitAll();
+
+
+
+myView = myViewManager.Create3DView();
+myView.SetTitle("The viewer for CutLines")
+print "myViewManager.Create3DView()"
time.sleep(aDelay)
-aColor = SALOMEDS.Color(0.0,0.0,0.0)
-myView.SetBackground(aColor);
print "myView.SetBackground(...)"
-myView.SaveViewParams('BBB');
-print "myView.SaveViewParams('BBB')"
+aColor = SALOMEDS.Color(0.7,0.7,0.7)
+myView.SetBackground(aColor);
time.sleep(aDelay)
-aColor = SALOMEDS.Color(1.0,1.0,1.0)
-myView.SetBackground(aColor);
-print "myView.SetBackground(...)"
+aCutLines = myVisu.CutLinesOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId)
+aCutLines.SetOrientation(VISU.CutPlanes.ZX,0,0)
+aCutLines.SetOrientation2(VISU.CutPlanes.YZ,0,0)
+
+myView.DisplayOnly(aCutLines);
+myView.FitAll();
+print "myView.DisplayOnly(aCutLines)"
time.sleep(aDelay)
-myView.ScaleView(VISU.View3D.ZAxis,0.5);
-print "myView.SetBackground(...)"
-myView.SaveViewParams('CCC');
-print "myView.SaveViewParams('CCC')"
+aSObj = myStudy.FindObjectIOR(aCutLines.GetID())
+aTable = myVisu.CreateTable( aSObj.GetID() )
+print "myVisu.CreateTable(...)"
+
+aTableView = myViewManager.CreateTableView(aTable)
+aTableView.SetTitle('Changed Title')
+
+aContainer = myVisu.CreateContainer()
+print "myVisu.CreateContainer(...)"
+
+aNbCurve = aTable.GetNbRows() - 1
+for i in range(2,aNbCurve):
+ aCurve = myVisu.CreateCurve( aTable, 1, i )
+ print i, aCurve
+ aContainer.AddCurve(aCurve)
+
+
+myView = myViewManager.CreateXYPlot();
+myView.SetTitle("The viewer for Curves from CutLines")
+print "myViewManager.CreateXYPlot()"
time.sleep(aDelay)
-myView.RestoreViewParams('BBB');
-print "myView.RestoreViewParams('BBB')"
+myView.Display(aContainer)
+
+
+
+myView = myViewManager.Create3DView();
+myView.SetTitle("The viewer for Animation")
+print "myViewManager.Create3DView()"
+time.sleep(aDelay)
-# Time animation
-myView.EraseAll()
medFile = "TimeStamps.med"
myFieldName = "vitesse";
print "Generate frames"
anAnim.generateFrames()
print "Start Animation"
-anAnim.setSpeed(12)
-#anAnim.setCycling(1)
+anAnim.setSpeed(99)
+anAnim.setCycling(1)
anAnim.startAnimation()
myView.FitAll()
-#anAnim.clearView()