if (anEdgeId >= 0) {
if(MYDEBUG) INFOS(" CellId : "<<anObjId<<"; EdgeId : "<<anEdgeId);
GetSelector()->AddOrRemoveIndex(anIO,anObjId,false);
- GetSelector()->AddOrRemoveIndex(anIO,-anEdgeId-1,false);
+ GetSelector()->AddOrRemoveIndex(anIO,-anEdgeId-1,true);
GetSelector()->AddIObject(aSActor);
}
}
}
}
}
- //if(MYDEBUG) INFOS ( " NAME PREVIEW " << aSActor->getName() );
}
}
}
#include "SVTK_ViewWindow.h"
#include "SALOME_ListIteratorOfListIO.hxx"
-#include "SVTK_Selector.h"
+#include "SVTK_SelectorDef.h"
#include "utilities.h"
-SVTK_Selector
-::SVTK_Selector()
+SVTK_SelectorDef
+::SVTK_SelectorDef()
{
}
-SVTK_Selector
-::~SVTK_Selector()
+SVTK_SelectorDef
+::~SVTK_SelectorDef()
{
}
void
-SVTK_Selector
+SVTK_SelectorDef
::SetSelectionMode(Selection_Mode theMode)
{
mySelectionMode = theMode;
}
void
-SVTK_Selector
+SVTK_SelectorDef
::ClearIObjects()
{
myIO2Actors.Clear();
myIObjects.Clear();
- myMapIOSubIndex.Clear();
+ //myMapIOSubIndex.Clear();
}
//----------------------------------------------------------------------------
bool
-SVTK_Selector
+SVTK_SelectorDef
::IsSelected(const Handle(SALOME_InteractiveObject)& theObject) const
{
SALOME_ListIteratorOfListIO anIter(myIObjects);
}
bool
-SVTK_Selector
+SVTK_SelectorDef
::IsSelected(SALOME_Actor* theActor) const
{
const Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
}
SALOME_Actor*
-SVTK_Selector
+SVTK_SelectorDef
::GetActor(const Handle(SALOME_InteractiveObject)& theIO) const
{
if(myIO2Actors.IsBound(theIO))
//----------------------------------------------------------------------------
bool
-SVTK_Selector
+SVTK_SelectorDef
::AddIObject(const Handle(SALOME_InteractiveObject)& theIO)
{
if(!IsSelected(theIO)){
}
bool
-SVTK_Selector
+SVTK_SelectorDef
::AddIObject(SALOME_Actor* theActor)
{
const Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
//----------------------------------------------------------------------------
bool
-SVTK_Selector
+SVTK_SelectorDef
::RemoveIObject(const Handle(SALOME_InteractiveObject)& theIO)
{
bool anIsIOBound = false;
}
bool
-SVTK_Selector
+SVTK_SelectorDef
::RemoveIObject(SALOME_Actor* theActor)
{
const Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
//----------------------------------------------------------------------------
const SALOME_ListIO&
-SVTK_Selector
+SVTK_SelectorDef
::StoredIObjects() const
{
return myIObjects;
}
int
-SVTK_Selector
+SVTK_SelectorDef
::IObjectCount() const
{
return myIObjects.Extent();
}
bool
-SVTK_Selector
+SVTK_SelectorDef
::HasIndex( const Handle(SALOME_InteractiveObject)& theIO) const
{
return myMapIOSubIndex.IsBound(theIO);
}
void
-SVTK_Selector
+SVTK_SelectorDef
::GetIndex( const Handle(SALOME_InteractiveObject)& theIO,
TColStd_IndexedMapOfInteger& theIndex)
{
}
bool
-SVTK_Selector
+SVTK_SelectorDef
::IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO,
int theIndex) const
{
bool
-SVTK_Selector
+SVTK_SelectorDef
::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
const TColStd_IndexedMapOfInteger& theIndices,
bool theIsModeShift)
bool
-SVTK_Selector
+SVTK_SelectorDef
::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
const TColStd_MapOfInteger& theIndices,
bool theIsModeShift)
bool
-SVTK_Selector
+SVTK_SelectorDef
::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
int theIndex,
bool theIsModeShift)
void
-SVTK_Selector
+SVTK_SelectorDef
::RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
int theIndex)
{
}
void
-SVTK_Selector
+SVTK_SelectorDef
::ClearIndex()
{
myMapIOSubIndex.Clear();
#ifndef SVTK_SELECTOR_H
#define SVTK_SELECTOR_H
-#include <NCollection_DataMap.hxx>
-#include <vtkSmartPointer.h>
+
#include <TColStd_MapOfInteger.hxx>
#include "SVTK_Selection.h"
-
#include "SALOME_ListIO.hxx"
#include "SALOME_InteractiveObject.hxx"
#include "SALOME_DataMapOfIOMapOfInteger.hxx"
class SALOME_Actor;
-class SVTK_Viewer;
-class SVTK_ViewWindow;
-
class SVTK_Selector
{
public:
- SVTK_Selector();
- virtual ~SVTK_Selector();
+ virtual ~SVTK_Selector() = 0;
+
+ virtual
+ void
+ SetSelectionMode( Selection_Mode theMode ) = 0;
- void SetSelectionMode( Selection_Mode theMode );
- Selection_Mode SelectionMode() const { return mySelectionMode; }
+ virtual
+ Selection_Mode
+ SelectionMode() const = 0;
+ virtual
void
- ClearIObjects();
+ ClearIObjects() = 0;
+ virtual
SALOME_Actor*
- GetActor(const Handle(SALOME_InteractiveObject)& theIO) const;
+ GetActor(const Handle(SALOME_InteractiveObject)& theIO) const = 0;
+
+ virtual
bool
- IsSelected(const Handle(SALOME_InteractiveObject)& theIO) const;
+ IsSelected(const Handle(SALOME_InteractiveObject)& theIO) const = 0;
+
+ virtual
bool
- IsSelected(SALOME_Actor* theActor) const;
+ IsSelected(SALOME_Actor* theActor) const = 0;
+ virtual
bool
- AddIObject(const Handle(SALOME_InteractiveObject)& theIO);
+ AddIObject(const Handle(SALOME_InteractiveObject)& theIO) = 0;
+
+ virtual
bool
- AddIObject(SALOME_Actor* theActor);
+ AddIObject(SALOME_Actor* theActor) = 0;
+ virtual
bool
- RemoveIObject(const Handle(SALOME_InteractiveObject)& theIO);
+ RemoveIObject(const Handle(SALOME_InteractiveObject)& theIO) = 0;
+
+ virtual
bool
- RemoveIObject(SALOME_Actor* theActor);
+ RemoveIObject(SALOME_Actor* theActor) = 0;
+ virtual
const SALOME_ListIO&
- StoredIObjects() const;
+ StoredIObjects() const = 0;
+ virtual
int
- IObjectCount() const;
+ IObjectCount() const = 0;
+ virtual
bool
- HasIndex(const Handle(SALOME_InteractiveObject)& theIO ) const;
+ HasIndex(const Handle(SALOME_InteractiveObject)& theIO ) const = 0;
+ virtual
void
GetIndex( const Handle(SALOME_InteractiveObject)& theIO,
- TColStd_IndexedMapOfInteger& theIndex );
+ TColStd_IndexedMapOfInteger& theIndex ) = 0;
+ virtual
bool
AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
const TColStd_IndexedMapOfInteger& theIndices,
- bool theIsModeShift);
+ bool theIsModeShift) = 0;
+ virtual
bool
AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
const TColStd_MapOfInteger& theIndices,
- bool theIsModeShift);
+ bool theIsModeShift) = 0;
+ virtual
bool
AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
int theIndex,
- bool theIsModeShift);
+ bool theIsModeShift) = 0;
+ virtual
void
RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- int theIndex);
+ int theIndex) = 0;
+ virtual
bool
IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO,
- int theIndex) const;
+ int theIndex) const = 0;
+ virtual
void
- ClearIndex();
-
-private:
- typedef NCollection_DataMap<Handle(SALOME_InteractiveObject),
- vtkSmartPointer<SALOME_Actor> > TIO2Actors;
- TIO2Actors myIO2Actors;
- Selection_Mode mySelectionMode;
- SALOME_ListIO myIObjects;
- SALOME_DataMapOfIOMapOfInteger myMapIOSubIndex;
+ ClearIndex() = 0;
};
--- /dev/null
+// SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//
+// 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 : SALOME_Selection.h
+// Author : Nicolas REJNERI
+// Module : SALOME
+// $Header$
+
+#ifndef SVTK_SELECTORDEF_H
+#define SVTK_SELECTORDEF_H
+
+#include <NCollection_DataMap.hxx>
+#include <vtkSmartPointer.h>
+#include <TColStd_MapOfInteger.hxx>
+
+#include "SVTK_Selector.h"
+
+class SALOME_Actor;
+
+class SVTK_Viewer;
+class SVTK_ViewWindow;
+
+class SVTK_SelectorDef: public SVTK_Selector
+{
+public:
+ SVTK_SelectorDef();
+ virtual ~SVTK_SelectorDef();
+
+ virtual
+ void
+ SetSelectionMode( Selection_Mode theMode );
+
+ virtual
+ Selection_Mode
+ SelectionMode() const { return mySelectionMode; }
+
+ virtual
+ void
+ ClearIObjects();
+
+ virtual
+ SALOME_Actor*
+ GetActor(const Handle(SALOME_InteractiveObject)& theIO) const;
+
+ virtual
+ bool
+ IsSelected(const Handle(SALOME_InteractiveObject)& theIO) const;
+
+ virtual
+ bool
+ IsSelected(SALOME_Actor* theActor) const;
+
+ virtual
+ bool
+ AddIObject(const Handle(SALOME_InteractiveObject)& theIO);
+
+ virtual
+ bool
+ AddIObject(SALOME_Actor* theActor);
+
+ virtual
+ bool
+ RemoveIObject(const Handle(SALOME_InteractiveObject)& theIO);
+
+ virtual
+ bool
+ RemoveIObject(SALOME_Actor* theActor);
+
+ virtual
+ const SALOME_ListIO&
+ StoredIObjects() const;
+
+ virtual
+ int
+ IObjectCount() const;
+
+ virtual
+ bool
+ HasIndex(const Handle(SALOME_InteractiveObject)& theIO ) const;
+
+ virtual
+ void
+ GetIndex( const Handle(SALOME_InteractiveObject)& theIO,
+ TColStd_IndexedMapOfInteger& theIndex );
+
+ virtual
+ bool
+ AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
+ const TColStd_IndexedMapOfInteger& theIndices,
+ bool theIsModeShift);
+ virtual
+ bool
+ AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
+ const TColStd_MapOfInteger& theIndices,
+ bool theIsModeShift);
+ virtual
+ bool
+ AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
+ int theIndex,
+ bool theIsModeShift);
+ virtual
+ void
+ RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
+ int theIndex);
+ virtual
+ bool
+ IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO,
+ int theIndex) const;
+ virtual
+ void
+ ClearIndex();
+
+private:
+ typedef NCollection_DataMap<Handle(SALOME_InteractiveObject),
+ vtkSmartPointer<SALOME_Actor> > TIO2Actors;
+ TIO2Actors myIO2Actors;
+ Selection_Mode mySelectionMode;
+ SALOME_ListIO myIObjects;
+ SALOME_DataMapOfIOMapOfInteger myMapIOSubIndex;
+};
+
+
+#endif
-#include "SVTK_Selector.h"
-#include "SALOME_Actor.h"
-
#include <qapplication.h>
#include <vtkActorCollection.h>
#include "SALOME_ListIteratorOfListIO.hxx"
+#include "SVTK_SelectorDef.h"
+#include "SALOME_Actor.h"
+
#include "VTKViewer_Algorithm.h"
#include "SVTK_Functor.h"
: SUIT_ViewWindow(theDesktop)
{
myModel = theModel;
- mySelector = new SVTK_Selector();
+ mySelector = new SVTK_SelectorDef();
connect(this,SIGNAL(selectionChanged()),theModel,SLOT(onSelectionChanged()));
myTransform = VTKViewer_Transform::New();