--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File: VISU_GaussPoints.cxx
+// Author: Alexey PETROV
+// Module : VISU
+
+
+#include "VISU_GaussPointsPL.hxx"
+#include "VISU_PipeLineUtils.hxx"
+
+vtkStandardNewMacro(VISU_GaussPointsPL);
+
+VISU_GaussPointsPL::VISU_GaussPointsPL()
+{
+ myFieldTransform = VISU_FieldTransform::New();
+
+ myMapperTable = VISU_LookupTable::New();
+ myMapperTable->SetScale(VTK_SCALE_LINEAR);
+ myMapperTable->SetHueRange(0.667,0.0);
+
+ myBarTable = VISU_LookupTable::New();
+ myBarTable->SetScale(VTK_SCALE_LINEAR);
+ myBarTable->SetHueRange(0.667,0.0);
+
+ myExtractor = VISU_Extractor::New();
+
+ myIsShrinkable = true;
+}
+
+void VISU_GaussPointsPL::Build()
+{
+ myExtractor->SetInput(GetInput2());
+ myFieldTransform->SetInput(myExtractor->GetOutput());
+
+ myMapper->SetColorModeToMapScalars();
+ myMapper->ScalarVisibilityOn();
+ myMapper->SetInput( myFieldTransform->GetUnstructuredGridOutput() );
+}
+
+void VISU_GaussPointsPL::Init()
+{
+}
+
+void VISU_GaussPointsPL::Update()
+{
+ float *aRange = myFieldTransform->GetScalarRange();
+ float aScalarRange[2] = {aRange[0], aRange[1]};
+ if(myBarTable->GetScale() == VTK_SCALE_LOG10)
+ VISU_LookupTable::ComputeLogRange(aRange,aScalarRange);
+ myMapperTable->SetRange(aScalarRange);
+ myMapperTable->SetMapScale(1.0);
+
+ myMapperTable->Build();
+ myBarTable->Build();
+
+ myMapper->SetLookupTable(myMapperTable);
+ myMapper->SetScalarRange(aScalarRange);
+
+ VISU_PipeLine::Update();
+}
+
+void VISU_GaussPointsPL::SetScalarRange(float theRange[2]){
+ myFieldTransform->SetScalarRange(theRange);
+ myBarTable->SetRange(theRange);
+ Modified();
+}
+
+void VISU_GaussPointsPL::GetSourceRange(float theRange[2]){
+ myExtractor->Update();
+ myExtractor->GetOutput()->GetScalarRange(theRange);
+}
+
+void VISU_GaussPointsPL::SetSourceRange(){
+ float aRange[2];
+ GetSourceRange(aRange);
+ SetScalarRange(aRange);
+}
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File: VISU_GaussPointsPL.hxx
+// Author:
+// Module : VISU
+
+#ifndef VISU_GaussPointsPL_HeaderFile
+#define VISU_GaussPointsPL_HeaderFile
+
+#include "VISU_PipeLine.hxx"
+#include "VISU_ScalarBarActor.hxx"
+
+class VISU_Extractor;
+class VISU_FieldTransform;
+
+class VISU_GaussPointsPL : public VISU_PipeLine
+{
+protected:
+ VISU_GaussPointsPL();
+
+public:
+ vtkTypeMacro(VISU_GaussPointsPL,VISU_PipeLine);
+ static VISU_GaussPointsPL* New();
+
+ virtual void SetScalarRange(float theRange[2]);
+
+public:
+ virtual void Init();
+ virtual void Build();
+ virtual void Update();
+
+ virtual VISU_LookupTable *GetMapperTable(){ return myMapperTable;}
+ virtual VISU_LookupTable *GetBarTable(){ return myBarTable;}
+
+ virtual void GetSourceRange(float theRange[2]);
+ virtual void SetSourceRange();
+
+protected:
+ VISU_LookupTable *myMapperTable, *myBarTable;
+ VISU_FieldTransform *myFieldTransform;
+ VISU_Extractor* myExtractor;
+};
+
+#endif
// Module : VISU
// $Header$
-#include "VisuGUI.h"
+#include "VisuGUI_Module.h"
#include "CAM_Module.h"
CAM_Module*
createModule()
{
- return new VisuGUI();
+ return new VisuGUI_Module();
}
}
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : VisuGUI_Module.cxx
+// Author : Laurent CORNABE
+// Module : VISU
+// $Header$
+
+#include "VisuGUI_Module.h"
+
+#include "SUIT_Study.h"
+#include "SUIT_Desktop.h"
+
+#include "SalomeApp_Application.h"
+#include "CAM_Module.h"
+
+#include "SVTK_ViewManager.h"
+#include "SVTK_ViewModel.h"
+
+//using namespace VISU;
+
+#ifdef _DEBUG_
+static int MYDEBUG = 1;
+#else
+static int MYDEBUG = 0;
+#endif
+
+VisuGUI_Module::VisuGUI_Module() : VisuGUI()
+{
+}
+
+
+VisuGUI_Module::~VisuGUI_Module()
+{
+}
+
+void
+VisuGUI_Module::
+initialize( CAM_Application* theApp )
+{
+ VisuGUI::initialize( theApp );
+
+ myViewManager = new SVTK_ViewManager( getApp()->activeStudy(), getApp()->desktop() );
+
+ SVTK_Viewer* aViewer = new SVTK_Viewer();
+ myViewManager->setViewModel( aViewer );
+
+ myViewManager->createViewWindow();
+ myViewManager->getActiveView()->hide();
+
+ theApp->addViewManager( myViewManager );
+}
+
+bool
+VisuGUI_Module::
+activateModule( SUIT_Study* theStudy )
+{
+ VisuGUI::activateModule( theStudy );
+
+ myViewManager->getActiveView()->show();
+
+ return true;
+}
+
+bool
+VisuGUI_Module::
+deactivateModule( SUIT_Study* theStudy )
+{
+ VisuGUI::deactivateModule( theStudy );
+
+ myViewManager->getActiveView()->hide();
+
+ return true;
+}
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : VisuGUI_Module.h
+// Author :
+// Module : VISU
+// $Header$
+
+#ifndef VisuGUI_Module_HeaderFile
+#define VisuGUI_Module_HeaderFile
+
+#include "VisuGUI.h"
+
+class SVTK_ViewManager;
+
+class VisuGUI_Module: public VisuGUI
+{
+ Q_OBJECT
+
+public:
+ VisuGUI_Module();
+ virtual ~VisuGUI_Module();
+
+ virtual void initialize( CAM_Application* );
+
+public slots:
+ virtual bool deactivateModule( SUIT_Study* );
+ virtual bool activateModule( SUIT_Study* );
+
+protected:
+ SVTK_ViewManager* myViewManager;
+};
+
+#endif