geom/src/DependencyTree/DependencyTree_Object.h

82 lines
2.5 KiB
C
Raw Normal View History

2016-03-15 17:26:56 +05:00
// Copyright (C) 2014-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2014-05-21 19:42:20 +06:00
//
// 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, 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
// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef DEPENDENCYTREE_OBJECT_H
#define DEPENDENCYTREE_OBJECT_H
#include <GraphicsView_Object.h>
// GEOM includes
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(GEOM_Gen)
2014-05-21 19:42:20 +06:00
#include <QPen>
2014-07-02 15:20:45 +06:00
#include "DependencyTree.h"
class DEPENDENCYTREE_EXPORT DependencyTree_Object: public GraphicsView_Object
2014-05-21 19:42:20 +06:00
{
public:
2014-05-23 14:09:19 +06:00
DependencyTree_Object( const std::string&, QGraphicsItem* = 0 );
2014-05-21 19:42:20 +06:00
~DependencyTree_Object();
virtual void compute() {};
virtual bool highlight( double, double );
virtual void unhighlight();
2014-05-21 19:42:20 +06:00
virtual bool select( double, double, const QRectF& );
virtual void unselect();
2014-05-21 19:42:20 +06:00
std::string getEntry() const;
2014-05-21 19:42:20 +06:00
GEOM::GEOM_BaseObject_var getGeomObject() const;
2014-05-21 19:42:20 +06:00
void updateName();
2014-05-21 19:42:20 +06:00
void setColor( const QColor& );
void setSelectColor( const QColor& );
void setMainObjectColor( const QColor& );
void setUnpublishObjectColor( const QColor& );
2014-05-21 19:42:20 +06:00
void setIsMainObject( bool );
2014-05-21 19:42:20 +06:00
private:
QPen getPen( const QColor& );
2014-05-21 19:42:20 +06:00
QColor myColor;
QColor mySelectColor;
QColor myMainObjectColor;
QColor myUnpublishObjectColor;
2014-05-21 19:42:20 +06:00
QGraphicsPolygonItem* myPolygonItem;
QGraphicsSimpleTextItem* myTextItem;
2014-05-21 19:42:20 +06:00
GEOM::GEOM_BaseObject_var myGeomObject;
std::string myEntry;
2014-05-21 19:42:20 +06:00
bool myIsMainObject;
2014-05-21 19:42:20 +06:00
};
#endif