0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / XCAFPrs / XCAFPrs_Driver.cxx
CommitLineData
b311480e 1// Created on: 2000-08-11
2// Created by: data exchange team
973c2be1 3// Copyright (c) 2000-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
7fd59977 16
42cf5bc1 17#include <AIS_InteractiveObject.hxx>
18#include <Standard_GUID.hxx>
19#include <Standard_Type.hxx>
7fd59977 20#include <TDF_Label.hxx>
21#include <TDocStd_Document.hxx>
42cf5bc1 22#include <XCAFDoc_ShapeTool.hxx>
23#include <XCAFPrs_AISObject.hxx>
24#include <XCAFPrs_Driver.hxx>
7fd59977 25
92efcf78 26IMPLEMENT_STANDARD_RTTIEXT(XCAFPrs_Driver,TPrsStd_Driver)
27
7fd59977 28//=======================================================================
29//function : Update
30//purpose :
31//=======================================================================
7fd59977 32Standard_Boolean XCAFPrs_Driver::Update (const TDF_Label& L,
33 Handle(AIS_InteractiveObject)& ais)
34
35{
36// cout << "XCAFPrs_Driver::Update" << endl;
37// WARNING! The label L can be out of any document
38// (this is a case for reading from the file)
39// Handle(TDocStd_Document) DOC = TDocStd_Document::Get(L);
40
41 XCAFDoc_ShapeTool shapes;
42 if ( ! shapes.IsShape(L) ) return Standard_False;
43
44 ais = new XCAFPrs_AISObject (L);
45
46 return Standard_True;
47}
48
49//=======================================================================
50//function : GetID
51//purpose :
52//=======================================================================
53
54const Standard_GUID& XCAFPrs_Driver::GetID()
55{
56 static Standard_GUID ID("5b896afc-3adf-11d4-b9b7-0060b0ee281b");
57 return ID;
58}