0024837: Visualization - revise design and implementation of connected Interactive...
[occt.git] / src / SelectMgr / SelectMgr_EntityOwner.cxx
old mode 100755 (executable)
new mode 100644 (file)
index cad2fe7..692713c
@@ -1,10 +1,18 @@
-// Copyright:  Matra-Datavision 1995
-// File:       SelectMgr_EntityOwner.cxx
-// Created:    Tue May 23 10:18:48 1995
-// Author:     Robert COUBLANC
-//             <rob>
-
-
+// Created on: 1995-05-23
+// Created by: Robert COUBLANC
+// Copyright (c) 1995-1999 Matra Datavision
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 #include <SelectMgr_EntityOwner.ixx>
 
 SelectMgr_EntityOwner::SelectMgr_EntityOwner(const Standard_Integer aPriority):
 SelectBasics_EntityOwner(aPriority),
 mySelectable(NULL),
-mystate(0)
+myIsSelected (Standard_False)
 {
 }
 
 SelectMgr_EntityOwner::SelectMgr_EntityOwner(const Handle(SelectMgr_SelectableObject)& aSO,
                                             const Standard_Integer aPriority):
 SelectBasics_EntityOwner(aPriority),
-mystate(0)
+myIsSelected (Standard_False)
 {
   mySelectable = aSO.operator->();
 }
 
+SelectMgr_EntityOwner::SelectMgr_EntityOwner (const Handle(SelectMgr_EntityOwner)& theOwner, const Standard_Integer aPriority)
+:
+  SelectBasics_EntityOwner(aPriority),
+  mySelectable (theOwner->mySelectable)
+{
+}
+
 
 //=======================================================================
 //function : About Selectable...
@@ -72,11 +87,12 @@ void SelectMgr_EntityOwner::HilightWithColor(const Handle(PrsMgr_PresentationMan
                                             const Quantity_NameOfColor aColor,
                                             const Standard_Integer aMode)
 {
-  if( HasSelectable() )
+  if( HasSelectable() ) {
     if( IsAutoHilight() )
       PM->Color(mySelectable,aColor,aMode);
     else
       mySelectable->HilightOwnerWithColor( PM, aColor, this );
+  }
 }
 
 void SelectMgr_EntityOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& PM,
@@ -86,8 +102,8 @@ void SelectMgr_EntityOwner::Unhilight(const Handle(PrsMgr_PresentationManager)&
     PM->Unhighlight(mySelectable,aMode);
 }
 
-void SelectMgr_EntityOwner::Clear(const Handle(PrsMgr_PresentationManager)& PM,
-                                 const Standard_Integer aMode)
+void SelectMgr_EntityOwner::Clear(const Handle(PrsMgr_PresentationManager)&,
+                                 const Standard_Integer)
 {
 // nothing done on the selectable here...
 }
@@ -97,25 +113,23 @@ void SelectMgr_EntityOwner::
 Hilight(){}
 
 
-
 //=======================================================================
-//function : about Location
+//function : about Transformation
 //purpose  : 
 //=======================================================================
 
 Standard_Boolean SelectMgr_EntityOwner::HasLocation() const
 {
-  return (HasSelectable() && mySelectable->HasLocation());
+  return (HasSelectable() && mySelectable->HasTransformation());
 }
 
 void SelectMgr_EntityOwner::SetLocation(const TopLoc_Location&)
 {
 }
 
-const TopLoc_Location& SelectMgr_EntityOwner::Location() const
+TopLoc_Location SelectMgr_EntityOwner::Location() const
 {
-  static TopLoc_Location anIdentity;
-  return HasSelectable() ? mySelectable->Location() : anIdentity;
+  return !HasSelectable() ? TopLoc_Location() : TopLoc_Location(mySelectable->Transformation());
 }
 
 void SelectMgr_EntityOwner::ResetLocation()
@@ -140,7 +154,7 @@ Standard_Boolean SelectMgr_EntityOwner::IsForcedHilight () const
 //purpose  :
 //=======================================================================
 void SelectMgr_EntityOwner::SetZLayer 
-  (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
-   const Standard_Integer theLayerId)
+  (const Handle(PrsMgr_PresentationManager)&,
+   const Standard_Integer)
 {
 }