Salome HOME
projects
/
samples
/
atomsolv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'V9_6_BR'
[samples/atomsolv.git]
/
src
/
ATOMSOLVGUI
/
ATOMSOLVGUI_Displayer.cxx
diff --git
a/src/ATOMSOLVGUI/ATOMSOLVGUI_Displayer.cxx
b/src/ATOMSOLVGUI/ATOMSOLVGUI_Displayer.cxx
index aa993bf373945759636eacda39e9f522e9d8814a..a254da1895ef911c61a970e07246ccbf2d769b78 100644
(file)
--- a/
src/ATOMSOLVGUI/ATOMSOLVGUI_Displayer.cxx
+++ b/
src/ATOMSOLVGUI/ATOMSOLVGUI_Displayer.cxx
@@
-1,9
+1,9
@@
-// Copyright (C) 2007-20
12
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-20
20
CEA/DEN, EDF R&D, OPEN CASCADE
//
// 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
//
// 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.
+// version 2.1 of the License
, or (at your option) any later version
.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-63,7
+63,7
@@
bool ATOMSOLVGUI_Displayer::canBeDisplayed( const QString& entry, const QString&
return result; // entry of an atom for sure
}
return result; // entry of an atom for sure
}
-ATOMGEN_ORB::Atom_ptr getAtom( const QString& entry,
const int studyID,
double& temprature )
+ATOMGEN_ORB::Atom_ptr getAtom( const QString& entry, double& temprature )
{
QStringList es = entry.split( "_" );
{
QStringList es = entry.split( "_" );
@@
-76,7
+76,7
@@
ATOMGEN_ORB::Atom_ptr getAtom( const QString& entry, const int studyID, double&
ATOMSOLV_ORB::ATOMSOLV_Gen_var engine = ATOMSOLVGUI::GetATOMSOLVGen();
ATOMSOLV_ORB::TMoleculeList_var molecules;
ATOMSOLV_ORB::ATOMSOLV_Gen_var engine = ATOMSOLVGUI::GetATOMSOLVGen();
ATOMSOLV_ORB::TMoleculeList_var molecules;
- if ( engine->getData(
studyID,
molecules ) && molID >= 0 && molID < molecules->length() ) {
+ if ( engine->getData( molecules ) && molID >= 0 && molID < molecules->length() ) {
ATOMSOLV_ORB::TMolecule tmol = molecules[ molID ];
ATOMGEN_ORB::Molecule_var mol = tmol.molecule;
if ( atomID < mol->getNbAtoms() ) {
ATOMSOLV_ORB::TMolecule tmol = molecules[ molID ];
ATOMGEN_ORB::Molecule_var mol = tmol.molecule;
if ( atomID < mol->getNbAtoms() ) {
@@
-95,27
+95,14
@@
void setTemperature( SALOME_Actor* actor, double temperature )
}
}
}
}
-int getStudyID()
-{
- int studyID = -1;
- if ( SUIT_Application* app = SUIT_Session::session()->activeApplication() )
- if ( SUIT_Study* study = app->activeStudy() )
- studyID = study->id();
- return studyID;
-}
-
SALOME_Prs* ATOMSOLVGUI_Displayer::buildPresentation( const QString& entry, SALOME_View* view )
{
SALOME_Prs* ATOMSOLVGUI_Displayer::buildPresentation( const QString& entry, SALOME_View* view )
{
- const int studyID = getStudyID();
- if ( studyID == -1 )
- return 0;
-
SVTK_Prs* prs = dynamic_cast<SVTK_Prs*>( LightApp_Displayer::buildPresentation( entry, view ) );
if ( !prs ) return 0;
double temperature;
SVTK_Prs* prs = dynamic_cast<SVTK_Prs*>( LightApp_Displayer::buildPresentation( entry, view ) );
if ( !prs ) return 0;
double temperature;
- ATOMGEN_ORB::Atom_var atom = getAtom( entry,
studyID,
temperature );
+ ATOMGEN_ORB::Atom_var atom = getAtom( entry, temperature );
if ( !CORBA::is_nil( atom ) ) {
// PRESENTATION FOR OCC VIEWER
if ( !CORBA::is_nil( atom ) ) {
// PRESENTATION FOR OCC VIEWER
@@
-138,7
+125,7
@@
SALOME_Prs* ATOMSOLVGUI_Displayer::buildPresentation( const QString& entry, SALO
vtkObj->SetPhiResolution( (int)( vtkObj->GetEndPhi() * quality_coefficient ) );
vtkPolyDataMapper* vtkMapper = vtkPolyDataMapper::New();
vtkObj->SetPhiResolution( (int)( vtkObj->GetEndPhi() * quality_coefficient ) );
vtkPolyDataMapper* vtkMapper = vtkPolyDataMapper::New();
- vtkMapper->SetInput
( vtkObj->GetOutpu
t() );
+ vtkMapper->SetInput
Connection( vtkObj->GetOutputPor
t() );
vtkObj->Delete();
vtkObj->Delete();
@@
-159,10
+146,9
@@
SALOME_Prs* ATOMSOLVGUI_Displayer::buildPresentation( const QString& entry, SALO
void ATOMSOLVGUI_Displayer::updateActor( SALOME_Actor* actor )
{
void ATOMSOLVGUI_Displayer::updateActor( SALOME_Actor* actor )
{
- const int studyID = getStudyID();
- if ( actor && actor->hasIO() && studyID >= 0 ) {
+ if ( actor && actor->hasIO() ) {
double temperature;
double temperature;
- getAtom( actor->getIO()->getEntry(),
studyID,
temperature );
+ getAtom( actor->getIO()->getEntry(), temperature );
setTemperature( actor, temperature );
actor->Update();
}
setTemperature( actor, temperature );
actor->Update();
}
@@
-221,7
+207,7
@@
QColor ATOMSOLVGUI_Displayer::getColor( const QString& entry )
lst->InitTraversal();
while ( vtkActor* actor = lst->GetNextActor() )
if ( SALOME_Actor* salomeActor = SALOME_Actor::SafeDownCast( actor ) ) {
lst->InitTraversal();
while ( vtkActor* actor = lst->GetNextActor() )
if ( SALOME_Actor* salomeActor = SALOME_Actor::SafeDownCast( actor ) ) {
-
vtkFloatingPointTyp
e r, g, b;
+
doubl
e r, g, b;
salomeActor->GetColor( r, g, b );
return QColor( (int)(r * 255.), (int)(g * 255.), (int)(b * 255.) );
}
salomeActor->GetColor( r, g, b );
return QColor( (int)(r * 255.), (int)(g * 255.), (int)(b * 255.) );
}