Salome HOME
projects
/
modules
/
geom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mantis issue 0020853: EDF 1394 GEOM: Partition fails between 2 faces. A patch by...
[modules/geom.git]
/
src
/
GEOMGUI
/
GEOM_Displayer.cxx
diff --git
a/src/GEOMGUI/GEOM_Displayer.cxx
b/src/GEOMGUI/GEOM_Displayer.cxx
index 6e3be0c5a1990a36b666578114084d9efee5274a..82853c712ff04441591de18bf7fd9352b4790a13 100644
(file)
--- a/
src/GEOMGUI/GEOM_Displayer.cxx
+++ b/
src/GEOMGUI/GEOM_Displayer.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
08
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-20
10
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-19,6
+19,7
@@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// GEOM GEOMGUI : GUI for Geometry component
// File : GEOM_Displayer.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
// GEOM GEOMGUI : GUI for Geometry component
// File : GEOM_Displayer.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
@@
-91,7
+92,6
@@
#include <GEOMImpl_Types.hxx>
#include <Graphic3d_HArray1OfBytes.hxx>
#include <GEOMImpl_Types.hxx>
#include <Graphic3d_HArray1OfBytes.hxx>
-using namespace std;
//================================================================
// Function : getActiveStudy
//================================================================
// Function : getActiveStudy
@@
-190,7
+190,7
@@
SUIT_SelectionFilter* GEOM_Displayer::getComplexFilter( const QList<int>* aSubSh
// Function : getEntry
// Purpose :
//================================================================
// Function : getEntry
// Purpose :
//================================================================
-static string getEntry( GEOM::GEOM_Object_ptr object )
+static st
d::st
ring getEntry( GEOM::GEOM_Object_ptr object )
{
SUIT_Session* session = SUIT_Session::session();
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
{
SUIT_Session* session = SUIT_Session::session();
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
@@
-200,7
+200,7
@@
static string getEntry( GEOM::GEOM_Object_ptr object )
if ( strcmp(IOR.in(), "") != 0 )
{
SalomeApp_Study* study = ( SalomeApp_Study* )app->activeStudy();
if ( strcmp(IOR.in(), "") != 0 )
{
SalomeApp_Study* study = ( SalomeApp_Study* )app->activeStudy();
- _PTR(SObject) SO ( study->studyDS()->FindObjectIOR( string(IOR) ) );
+ _PTR(SObject) SO ( study->studyDS()->FindObjectIOR( st
d::st
ring(IOR) ) );
if ( SO )
return SO->GetID();
}
if ( SO )
return SO->GetID();
}
@@
-212,7
+212,7
@@
static string getEntry( GEOM::GEOM_Object_ptr object )
// Function : getName
// Purpose :
//================================================================
// Function : getName
// Purpose :
//================================================================
-static string getName( GEOM::GEOM_Object_ptr object )
+static st
d::st
ring getName( GEOM::GEOM_Object_ptr object )
{
SUIT_Session* session = SUIT_Session::session();
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
{
SUIT_Session* session = SUIT_Session::session();
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
@@
-222,7
+222,7
@@
static string getName( GEOM::GEOM_Object_ptr object )
if ( strcmp(IOR.in(), "") != 0 )
{
SalomeApp_Study* study = ( SalomeApp_Study* )app->activeStudy();
if ( strcmp(IOR.in(), "") != 0 )
{
SalomeApp_Study* study = ( SalomeApp_Study* )app->activeStudy();
- _PTR(SObject) aSObj ( study->studyDS()->FindObjectIOR( string(IOR) ) );
+ _PTR(SObject) aSObj ( study->studyDS()->FindObjectIOR( st
d::st
ring(IOR) ) );
_PTR(GenericAttribute) anAttr;
_PTR(GenericAttribute) anAttr;
@@
-327,7
+327,7
@@
void GEOM_Displayer::Display( GEOM::GEOM_Object_ptr theObj, const bool updateVie
if ( theObj->_is_nil() )
return;
if ( theObj->_is_nil() )
return;
- string entry = getEntry( theObj );
+ st
d::st
ring entry = getEntry( theObj );
if ( entry != "" ) {
Display(new SALOME_InteractiveObject(entry.c_str(), "GEOM", getName(theObj).c_str()),
updateViewer);
if ( entry != "" ) {
Display(new SALOME_InteractiveObject(entry.c_str(), "GEOM", getName(theObj).c_str()),
updateViewer);
@@
-371,7
+371,7
@@
void GEOM_Displayer::Erase( GEOM::GEOM_Object_ptr theObj,
const bool forced,
const bool updateViewer )
{
const bool forced,
const bool updateViewer )
{
- string entry = getEntry( theObj );
+ st
d::st
ring entry = getEntry( theObj );
if ( entry != "" )
{
Erase(new SALOME_InteractiveObject(entry.c_str(), "GEOM", getName(theObj).c_str()),
if ( entry != "" )
{
Erase(new SALOME_InteractiveObject(entry.c_str(), "GEOM", getName(theObj).c_str()),
@@
-550,7
+550,7
@@
void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
AISShape = new GEOM_AISShape (myShape, "");
}
// Temporary staff: vertex must be infinite for correct visualization
AISShape = new GEOM_AISShape (myShape, "");
}
// Temporary staff: vertex must be infinite for correct visualization
- AISShape->SetInfiniteState( myShape.Infinite()
|| myShape.ShapeType() == TopAbs_VERTEX );
+ AISShape->SetInfiniteState( myShape.Infinite()
); // || myShape.ShapeType() == TopAbs_VERTEX // VSR: 05/04/2010: Fix 20668 (Fit All for points & lines)
// Setup shape properties here ..., e.g. display mode, color, transparency, etc
AISShape->SetDisplayMode( myDisplayMode );
// Setup shape properties here ..., e.g. display mode, color, transparency, etc
AISShape->SetDisplayMode( myDisplayMode );
@@
-577,14
+577,14
@@
void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
if ( HasColor() )
{
AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
if ( HasColor() )
{
AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
+ Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
+ anAspect->SetColor( (Quantity_NameOfColor)GetColor() );
if ( myShape.ShapeType() == TopAbs_VERTEX )
{
if ( myShape.ShapeType() == TopAbs_VERTEX )
{
- Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
- anAspect->SetColor( (Quantity_NameOfColor)GetColor() );
anAspect->SetScale( myScaleOfMarker );
anAspect->SetTypeOfMarker( myTypeOfMarker );
anAspect->SetScale( myScaleOfMarker );
anAspect->SetTypeOfMarker( myTypeOfMarker );
- AISShape->Attributes()->SetPointAspect( anAspect );
}
}
+ AISShape->Attributes()->SetPointAspect( anAspect );
}
else
{
}
else
{
@@
-636,6
+636,7
@@
void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
// IMP 0020626
double aDC = aResMgr->doubleValue("Geometry", "deflection_coeff", 0.001);
// IMP 0020626
double aDC = aResMgr->doubleValue("Geometry", "deflection_coeff", 0.001);
+ aDC = std::max( aDC, DEFLECTION_MIN ); // to avoid to small values of the coefficient
AISShape->SetOwnDeviationCoefficient(aDC);
}
}
AISShape->SetOwnDeviationCoefficient(aDC);
}
}
@@
-698,7
+699,7
@@
void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
if ( strcmp(IOR.in(), "") != 0 )
{
_PTR(Study) aStudy = study->studyDS();
if ( strcmp(IOR.in(), "") != 0 )
{
_PTR(Study) aStudy = study->studyDS();
- _PTR(SObject) aMainSObject( aStudy->FindObjectIOR( string(IOR) ) );
+ _PTR(SObject) aMainSObject( aStudy->FindObjectIOR( st
d::st
ring(IOR) ) );
_PTR(ChildIterator) it( aStudy->NewChildIterator( aMainSObject ) );
for( ; it->More(); it->Next() )
{
_PTR(ChildIterator) it( aStudy->NewChildIterator( aMainSObject ) );
for( ; it->More(); it->Next() )
{
@@
-1425,12
+1426,12
@@
SALOMEDS::Color GEOM_Displayer::getUniqueColor( const QList<SALOMEDS::Color>& th
if( aTolerance < 1 )
break;
}
if( aTolerance < 1 )
break;
}
- //
cout << "Iteration N" << anIterations << " (tolerance=" << aTolerance << ")"<<
endl;
+ //
std::cout << "Iteration N" << anIterations << " (tolerance=" << aTolerance << ")"<< std::
endl;
aHue = (int)( 360.0 * rand() / RAND_MAX );
aHue = (int)( 360.0 * rand() / RAND_MAX );
- //
cout << "Hue = " << aHue <<
endl;
+ //
std::cout << "Hue = " << aHue << std::
endl;
- //cout << "Auto colors : ";
+ //
std::
cout << "Auto colors : ";
bool ok = true;
QList<SALOMEDS::Color>::const_iterator it = theReservedColors.constBegin();
QList<SALOMEDS::Color>::const_iterator itEnd = theReservedColors.constEnd();
bool ok = true;
QList<SALOMEDS::Color>::const_iterator it = theReservedColors.constBegin();
QList<SALOMEDS::Color>::const_iterator itEnd = theReservedColors.constEnd();
@@
-1441,21
+1442,21
@@
SALOMEDS::Color GEOM_Displayer::getUniqueColor( const QList<SALOMEDS::Color>& th
int h, s, v;
aQColor.getHsv( &h, &s, &v );
int h, s, v;
aQColor.getHsv( &h, &s, &v );
- //cout << h << " ";
+ //
std::
cout << h << " ";
if( abs( h - aHue ) < aTolerance )
{
ok = false;
if( abs( h - aHue ) < aTolerance )
{
ok = false;
- //cout << "break (diff = " << abs( h - aHue ) << ")";
+ //
std::
cout << "break (diff = " << abs( h - aHue ) << ")";
break;
}
}
break;
}
}
- //
cout <<
endl;
+ //
std::cout << std::
endl;
if( ok )
break;
}
if( ok )
break;
}
- //
cout << "Hue of the returned color = " << aHue <<
endl;
+ //
std::cout << "Hue of the returned color = " << aHue << std::
endl;
QColor aColor;
aColor.setHsv( aHue, 255, 255 );
QColor aColor;
aColor.setHsv( aHue, 255, 255 );