1 // Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "CurveCreator_Displayer.hxx"
22 CurveCreator_Displayer::CurveCreator_Displayer( Handle(AIS_InteractiveContext) theContext,
23 const int theZLayer ) :
24 myContext( theContext ), myZLayer( theZLayer )
29 CurveCreator_Displayer::~CurveCreator_Displayer(void)
32 for( int i = 0 ; i < myObjects.size() ; i++ ){
33 myObjects[i].Nullify();
38 void CurveCreator_Displayer::display( const Handle(AIS_InteractiveObject)& theObject, bool isUpdate )
40 if ( theObject.IsNull() )
43 myObjects.push_back( theObject );
44 myContext->Display( theObject, Standard_False );
47 myContext->SetZLayer( theObject, myZLayer );
50 myContext->UpdateCurrentViewer();
53 void CurveCreator_Displayer::eraseAll( bool isUpdate )
57 for( int i = 0 ; i < myObjects.size() ; i++ )
58 myContext->Erase(myObjects[i], Standard_False);
61 myContext->UpdateCurrentViewer();
64 void CurveCreator_Displayer::erase( const Handle(AIS_InteractiveObject)& theObject, bool isUpdate )
66 if(theObject.IsNull())
68 myContext->Erase(theObject, Standard_False);
70 myContext->UpdateCurrentViewer();
73 Quantity_Color CurveCreator_Displayer::getActiveColor( bool isHL )
76 return Quantity_Color( 1., 0., 0., Quantity_TOC_RGB );
78 return Quantity_Color( 0., 1., 0., Quantity_TOC_RGB );
81 void CurveCreator_Displayer::Update()
83 for( int i = 0 ; i < myObjects.size() ; i++ )
84 myContext->Update(myObjects[i], Standard_True);
85 myContext->UpdateCurrentViewer();
88 /*void CurveCreator_Displayer::highlight( const AISObjectsList& theObjects, bool isHL )
92 Quantity_Color aColor = getActiveColor( isHL );
93 for( int i = 0 ; i < theObjects.size() ; i++ ){
94 theObjects[i]->SetColor(aColor);
95 myContext->Display(theObjects[i], Standard_False);
97 myContext->UpdateCurrentViewer();