From: ouv Date: Thu, 11 Aug 2005 15:09:32 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: BR-D5-38-2003_D2005-12-09~126 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2e805e310eb1e962d2010c396d607349008138c6;p=modules%2Fvisu.git *** empty log message *** --- diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx new file mode 100644 index 00000000..ff967b12 --- /dev/null +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -0,0 +1,98 @@ +// 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); +} diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx new file mode 100644 index 00000000..9708b163 --- /dev/null +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -0,0 +1,65 @@ +// 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 diff --git a/src/VISUGUI/VisuGUI_Factory.cxx b/src/VISUGUI/VisuGUI_Factory.cxx index 24ea841b..fea679cb 100644 --- a/src/VISUGUI/VisuGUI_Factory.cxx +++ b/src/VISUGUI/VisuGUI_Factory.cxx @@ -26,7 +26,7 @@ // Module : VISU // $Header$ -#include "VisuGUI.h" +#include "VisuGUI_Module.h" #include "CAM_Module.h" @@ -34,7 +34,7 @@ extern "C" { CAM_Module* createModule() { - return new VisuGUI(); + return new VisuGUI_Module(); } } diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx new file mode 100644 index 00000000..82d784da --- /dev/null +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -0,0 +1,94 @@ +// 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; +} diff --git a/src/VISUGUI/VisuGUI_Module.h b/src/VISUGUI/VisuGUI_Module.h new file mode 100644 index 00000000..02df1622 --- /dev/null +++ b/src/VISUGUI/VisuGUI_Module.h @@ -0,0 +1,54 @@ +// 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