this->Modified();
vtkMapper *aMapper = myPipeLine->GetMapper();
vtkDataSet *aDataSet = aMapper->GetInput();
- if(!aDataSet)
- throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no input data !!!");
- aDataSet->Update();
- static float eps = VTK_LARGE_FLOAT * 0.1 ;
- if(aDataSet->GetLength() > eps)
- throw std::runtime_error("VISU_Actor::SetPipeLine >> Diagonal of the actor is too large !!!");
- if(!aDataSet->GetNumberOfCells())
- throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no visible elements");
+
+ //This code has been moved into VISU::Prs3d_i::UpdateActor() for bug 9808
+ //if(!aDataSet)
+ // throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no input data !!!");
+ //aDataSet->Update();
+ //static float eps = VTK_LARGE_FLOAT * 0.1 ;
+ //if(aDataSet->GetLength() > eps)
+ // throw std::runtime_error("VISU_Actor::SetPipeLine >> Diagonal of the actor is too large !!!");
+ //if(!aDataSet->GetNumberOfCells())
+ // throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no visible elements");
+
//Bug SAL4221: Mesh with less than 10 cells : shrink mode disable
//SetShrinkable(aDataSet->GetNumberOfCells() > 10);
SetShrinkable(true);
float aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
for (int i = 0; i < theNbPlanes; i++){
aPosition = aStartPosition + i*aDBoundPrj;
- float aDelta = (aBoundPrj[0] - aPosition) / aBoundPrj[2];
if(thePlaneCondition[i]){
aPosition = aStartPosition + i*aDBoundPrj;
}else
try{
thePrs->Update();
//UpdateViewer(thePrs); Avoid unnessary settings of visibility on for thePrs
+ bool isPublished = false;
for(int i = 0, nbFrames = GetActiveStudy()->getStudyFramesCount(); i < nbFrames; i++)
if(QAD_StudyFrame* aFrame = GetActiveStudy()->getStudyFrame(i)){
QAD_ViewFrame* aVFrame = aFrame->getRightFrame()->getViewFrame();
if(VTKViewer_ViewFrame* aViewFrame = dynamic_cast<VTKViewer_ViewFrame*>(aVFrame))
- if(VISU_Actor* anActor = GetActor(thePrs,aViewFrame))
- thePrs->UpdateActor(anActor);
+ if(VISU_Actor* anActor = GetActor(thePrs,aViewFrame)) {
+ isPublished = true;
+ thePrs->UpdateActor(anActor);
+ }
+ }
+
+ if (!isPublished) {
+ if (VTKViewer_ViewFrame* vf = GetVtkViewFrame()) {
+ if (VISU_Actor* anActor = thePrs->CreateActor())
+ vf->AddActor(anActor);
}
+ }
}catch(std::runtime_error& ex){
INFOS(ex.what());
QApplication::restoreOverrideCursor();
QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
- tr ("ERR_CANT_BUILD_PRESENTATION") + " " + tr(ex.what()),
+ tr ("ERR_CANT_BUILD_PRESENTATION") + ": " + tr(ex.what()),
tr ("VISU_BUT_OK") );
for(int i = 0, nbFrames = GetActiveStudy()->getStudyFramesCount(); i < nbFrames; i++)
if(QAD_StudyFrame* aFrame = GetActiveStudy()->getStudyFrame(i)){
}catch(std::runtime_error& exc){
INFOS(exc.what());
QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
- tr ("ERR_CANT_CREATE_ACTOR") + " " + tr(exc.what()),
+ tr ("ERR_CANT_CREATE_ACTOR") + ": " + tr(exc.what()),
tr ("VISU_BUT_OK") );
}
}
} catch ( std::runtime_error& exc ){
INFOS(exc.what());
QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
- tr("ERR_CANT_VISUALIZE_OBJECT") + " " + tr(exc.what()),
+ tr("ERR_CANT_VISUALIZE_OBJECT") + ": " + tr(exc.what()),
tr ("VISU_BUT_OK") );
anVISUActor = NULL;
}
using namespace VISU;
using namespace std;
+static float EPS_machine = 1.0E-7;
+
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
for(int i = 0; i < aNbPoints; i++){
aDataSet->GetPoint(i,aPnt);
Sub(aPnt,aBasePnt,aVect);
- aDist = vtkMath::Dot(aVect,aDirLn) / aBoundPrjLn[2];
- // the workaround
- if(aDist < 0.0) aDist = 0.0;
- if(aDist > 1.0) aDist = 1.0;
+ if ( fabs(aBoundPrjLn[2]) < EPS_machine )
+ aDist = 0.5;
+ else {
+ aDist = vtkMath::Dot(aVect,aDirLn) / aBoundPrjLn[2];
+ // the workaround
+ if(aDist < 0.0) aDist = 0.0;
+ if(aDist > 1.0) aDist = 1.0;
+ }
aXYMap[aDist] = aScalars->GetTuple1(i);
}
if(aFilter){
#include "VISU_Actor.h"
#include <vtkGeometryFilter.h>
+#include <vtkDataSet.h>
#include <vtkDataSetMapper.h>
using namespace VISU;
void VISU::Prs3d_i::UpdateActor(VISU_Actor* theActor) {
if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor() - this = "<<this);
- theActor->GetMapper()->ShallowCopy(myPipeLine->GetMapper());
+
+ // fix for bug 9808 BEGIN
+ vtkMapper *aMapper = myPipeLine->GetMapper();
+ vtkDataSet *aDataSet = aMapper->GetInput();
+ if (!aDataSet)
+ throw std::runtime_error("There is no input data !!!");
+ aDataSet->Update();
+ static float eps = VTK_LARGE_FLOAT * 0.1 ;
+ if (!aDataSet->GetNumberOfCells())
+ throw std::runtime_error("There is no visible elements");
+ if (aDataSet->GetLength() > eps)
+ throw std::runtime_error("Diagonal of the actor is too large !!!");
+ // fix for bug 9808 END
+
+ //theActor->GetMapper()->ShallowCopy(myPipeLine->GetMapper());
+ theActor->GetMapper()->ShallowCopy(aMapper);
theActor->Modified();
}