1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-06-10 11:34:06 +03:00

0033397: Data Exchange - Implementing support for the Animation storage

Implement basis structure.
Filled basic animation structures.
This commit is contained in:
dpasukhi 2023-05-25 00:11:53 +01:00 committed by oan
parent 1e36ce609f
commit a0758a8002
28 changed files with 1369 additions and 4 deletions

View File

@ -1,6 +1,7 @@
XCAFApp
XCAFAnimObjects
XCAFDimTolObjects
XCAFNoteObjects
XCAFDoc
XCAFPrs
XCAFView
XCAFView

20
src/XCAFAnimObjects/FILES Normal file
View File

@ -0,0 +1,20 @@
XCAFAnimObjects_AnimObject.cxx
XCAFAnimObjects_AnimObject.hxx
XCAFAnimObjects_CustomOperation.cxx
XCAFAnimObjects_CustomOperation.hxx
XCAFAnimObjects_InterpolationType.hxx
XCAFAnimObjects_Operation.cxx
XCAFAnimObjects_Operation.hxx
XCAFAnimObjects_OperationType.hxx
XCAFAnimObjects_Orient.cxx
XCAFAnimObjects_Orient.hxx
XCAFAnimObjects_Rotate.cxx
XCAFAnimObjects_Rotate.hxx
XCAFAnimObjects_Scale.cxx
XCAFAnimObjects_Scale.hxx
XCAFAnimObjects_Skew.cxx
XCAFAnimObjects_Skew.hxx
XCAFAnimObjects_Transform.cxx
XCAFAnimObjects_Transform.hxx
XCAFAnimObjects_Translate.cxx
XCAFAnimObjects_Translate.hxx

View File

@ -0,0 +1,132 @@
// Copyright (c) 2023 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 <XCAFDoc_AnimationTool.hxx>
#include <BRep_Builder.hxx>
#include <gp_Pnt.hxx>
#include <gp_Trsf.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_SequenceOfHAsciiString.hxx>
#include <TDataStd_Name.hxx>
#include <TDataStd_TreeNode.hxx>
#include <TDataStd_UAttribute.hxx>
#include <TDF_Attribute.hxx>
#include <TDF_ChildIDIterator.hxx>
#include <TDF_ChildIterator.hxx>
#include <TDF_Label.hxx>
#include <TDF_LabelMap.hxx>
#include <TDF_LabelSequence.hxx>
#include <TDF_RelocationTable.hxx>
#include <TDF_Tool.hxx>
#include <TDocStd_Document.hxx>
#include <TNaming_Builder.hxx>
#include <TNaming_Tool.hxx>
#include <TopLoc_IndexedMapOfLocation.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfOrientedShape.hxx>
#include <XCAFDoc.hxx>
#include <XCAFDoc_GraphNode.hxx>
#include <XCAFDoc_Location.hxx>
#include <XCAFDoc_ShapeMapTool.hxx>
IMPLEMENT_DERIVED_ATTRIBUTE_WITH_TYPE(XCAFDoc_AnimationTool, TDataStd_GenericEmpty, "xcaf", "AnimationTool")
//=======================================================================
//function : GetID
//purpose :
//=======================================================================
const Standard_GUID& XCAFDoc_AnimationTool::GetID()
{
static Standard_GUID ShapeToolID("9E9914DD-154A-4E17-B89B-3E33CCF67BD0");
return ShapeToolID;
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
Handle(XCAFDoc_AnimationTool) XCAFDoc_AnimationTool::Set(const TDF_Label& theLabel)
{
Handle(XCAFDoc_AnimationTool) anAnimTool;
if (!theLabel.FindAttribute(XCAFDoc_AnimationTool::GetID(), anAnimTool)) {
anAnimTool = new XCAFDoc_AnimationTool();
theLabel.AddAttribute(anAnimTool);
}
return anAnimTool;
}
//=======================================================================
//function : Constructor
//purpose :
//=======================================================================
XCAFDoc_AnimationTool::XCAFDoc_AnimationTool()
{}
//=======================================================================
//function : ID
//purpose :
//=======================================================================
const Standard_GUID& XCAFDoc_AnimationTool::ID() const
{
return GetID();
}
//=======================================================================
//function : BaseLabel
//purpose :
//=======================================================================
TDF_Label XCAFDoc_AnimationTool::BaseLabel() const
{
return Label();
}
//=======================================================================
//function : Dump
//purpose :
//=======================================================================
Standard_OStream& XCAFDoc_AnimationTool::Dump(Standard_OStream& theOStream,
const Standard_Boolean theDepth) const
{
(void)theOStream;
(void)theDepth;
}
//=======================================================================
//function : Dump
//purpose :
//=======================================================================
Standard_OStream& XCAFDoc_AnimationTool::Dump(Standard_OStream& theDumpLog) const
{
TDF_Attribute::Dump(theDumpLog);
Dump(theDumpLog, Standard_False);
return theDumpLog;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void XCAFDoc_AnimationTool::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
(void)theOStream;
(void)theDepth;
}

View File

@ -0,0 +1,83 @@
// Copyright (c) 2023 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.
#ifndef _XCAFDoc_AnimationTool_HeaderFile
#define _XCAFDoc_AnimationTool_HeaderFile
#include <Standard.hxx>
#include <XCAFDoc_DataMapOfShapeLabel.hxx>
#include <Standard_Boolean.hxx>
#include <TDataStd_NamedData.hxx>
#include <TDataStd_GenericEmpty.hxx>
#include <TDF_LabelMap.hxx>
#include <TDF_LabelSequence.hxx>
#include <Standard_Integer.hxx>
#include <Standard_OStream.hxx>
#include <TColStd_SequenceOfHAsciiString.hxx>
#include <TDF_AttributeSequence.hxx>
#include <TopTools_SequenceOfShape.hxx>
class Standard_GUID;
class TDF_Label;
class TopoDS_Shape;
class TopLoc_Location;
class XCAFDoc_GraphNode;
//! A tool to store shapes in an XDE
//! document in the form of assembly structure, and to maintain this structure.
//! Attribute containing Shapes section of DECAF document.
//! Provide tools for management of Shapes section.
//! The API provided by this class allows to work with this
//! structure regardless of its low-level implementation.
//! All the shapes are stored on child labels of a main label which is
//! XCAFDoc_DocumentTool::LabelShapes(). The label for assembly also has
//! sub-labels, each of which represents the instance of
//! another shape in that assembly (component). Such sub-label
//! stores reference to the label of the original shape in the form
//! of TDataStd_TreeNode with GUID XCAFDoc::ShapeRefGUID(), and its
//! location encapsulated into the NamedShape.
//! For correct work with an XDE document, it is necessary to use
//! methods for analysis and methods for working with shapes.
class XCAFDoc_AnimationTool : public TDataStd_GenericEmpty
{
public:
Standard_EXPORT static const Standard_GUID& GetID();
//! Create (if not exist) ShapeTool from XCAFDoc on <L>.
Standard_EXPORT static Handle(XCAFDoc_AnimationTool) Set (const TDF_Label& theLabel);
//! Creates an empty tool
//! Creates a tool to work with a document <Doc>
//! Attaches to label XCAFDoc::LabelShapes()
Standard_EXPORT XCAFDoc_AnimationTool();
//! returns the label under which shapes are stored
Standard_EXPORT TDF_Label BaseLabel() const;
Standard_EXPORT Standard_OStream& Dump (Standard_OStream& theOStream, const Standard_Boolean theDepth) const;
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& theOStream) const Standard_OVERRIDE;
Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_AnimationTool,TDataStd_GenericEmpty)
};
#endif // _XCAFDoc_AnimationTool_HeaderFile

View File

@ -0,0 +1,46 @@
// Copyright (c) 2023 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 "XCAFAnimObjects_CustomOperation.hxx"
//=======================================================================
//function : XCAFAnimObjects_CustomOperation
//purpose :
//=======================================================================
XCAFAnimObjects_CustomOperation::XCAFAnimObjects_CustomOperation(const int theObjectSize,
const TCollection_AsciiString& theCustomTypeName,
const NCollection_Array1<char>& thePresentation) :
XCAFAnimObjects_Operation(false),
myObjectSize(theObjectSize),
myTypeName(theCustomTypeName),
myPresentation(1, 1, thePresentation.Lower(), thePresentation.Upper())
{
for (int anInd = thePresentation.Lower(); anInd <= thePresentation.Upper(); anInd++)
{
myPresentation.SetValue(1, anInd, thePresentation.Value(anInd));
}
}
//=======================================================================
//function : XCAFAnimObjects_CustomOperation
//purpose :
//=======================================================================
XCAFAnimObjects_CustomOperation::XCAFAnimObjects_CustomOperation(const int theObjectSize,
const TCollection_AsciiString& theCustomTypeName,
const NCollection_Array2<char>& thePresentation,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myObjectSize(theObjectSize),
myTypeName(theCustomTypeName),
myPresentation(thePresentation)
{}

View File

@ -0,0 +1,56 @@
// Copyright (c) 2023 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.
#ifndef _XCAFAnimObjects_CustomOperation_HeaderFile
#define _XCAFAnimObjects_CustomOperation_HeaderFile
#include <XCAFAnimObjects_Operation.hxx>
#include <NCollection_Array2.hxx>
#include <TCollection_AsciiString.hxx>
//!
class XCAFAnimObjects_CustomOperation : public XCAFAnimObjects_Operation
{
public:
//!
Standard_EXPORT XCAFAnimObjects_CustomOperation(const int theObjectSize,
const TCollection_AsciiString& theCustomTypeName,
const NCollection_Array1<char>& thePresentation);
//!
Standard_EXPORT XCAFAnimObjects_CustomOperation(const int theObjectSize,
const TCollection_AsciiString& theCustomTypeName,
const NCollection_Array2<char>& thePresentation,
const NCollection_Array1<double>& theTimeStamps);
//!
XCAFAnimObjects_OperationType GetType() const Standard_OVERRIDE { return XCAFAnimObjects_OperationType_Custom; }
//!
int ObjectSize() const { return myObjectSize; }
//!
const TCollection_AsciiString& CustomTypeName() const { return myTypeName; }
//!
const NCollection_Array2<char>& CustomPresentation() const { return myPresentation; }
private:
int myObjectSize; //!<
TCollection_AsciiString myTypeName; //!<
NCollection_Array2<char> myPresentation; //!<
};
#endif // _XCAFAnimObjects_CustomOperation_HeaderFile

View File

@ -0,0 +1,27 @@
// Copyright (c) 2023 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.
#ifndef _XCAFAnimObjects_InterpolationType_HeaderFile
#define _XCAFAnimObjects_InterpolationType_HeaderFile
//! Interpolation is a description of behavior between timestamps
enum XCAFAnimObjects_InterpolationType
{
XCAFAnimObjects_InterpolationType_Custom = 0, //!< User-defined interpolation
XCAFAnimObjects_InterpolationType_Step, //!< No interpolation, just apply timestamps step by step
XCAFAnimObjects_InterpolationType_Linear, //!< Linear dependency from t_(i) to t_(i+1)
XCAFAnimObjects_InterpolationType_CubicSpline, //!< Cubic dependency from t_(i) to t_(i+1)
XCAFAnimObjects_InterpolationType_Static //!< No animation in this time period, use the closest static value
};
#endif // _XCAFAnimObjects_InterpolationType_HeaderFile

View File

@ -0,0 +1,32 @@
// Copyright (c) 2023 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 <XCAFAnimObjects_Operation.hxx>
//=======================================================================
//function : XCAFAnimObjects_Operation
//purpose :
//=======================================================================
XCAFAnimObjects_Operation::XCAFAnimObjects_Operation(const bool theIsInverse) :
myIsInverse(theIsInverse)
{}
//=======================================================================
//function : XCAFAnimObjects_Operation
//purpose :
//=======================================================================
XCAFAnimObjects_Operation::XCAFAnimObjects_Operation(const NCollection_Array1<double>& theTimeStamps,
const bool theIsInverse) :
myIsInverse(theIsInverse),
myTimeStamps(theTimeStamps)
{}

View File

@ -0,0 +1,52 @@
// Copyright (c) 2023 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.
#ifndef _XCAFAnimObjects_Operation_HeaderFile
#define _XCAFAnimObjects_Operation_HeaderFile
#include <NCollection_Array1.hxx>
#include <XCAFAnimObjects_OperationType.hxx>
//!
class XCAFAnimObjects_Operation
{
public:
//!
Standard_EXPORT XCAFAnimObjects_Operation(const bool theIsInverse = false);
//!
Standard_EXPORT XCAFAnimObjects_Operation(const NCollection_Array1<double>& theTimeStamps,
const bool theIsInverse = false);
//!
const NCollection_Array1<double>& TimeStamps() const { return myTimeStamps; }
//!
bool HasTimeStamps() const { return myTimeStamps.IsEmpty(); }
//!
Standard_EXPORT virtual XCAFAnimObjects_OperationType GetType() const = 0;
//!
bool IsInverse() const { return myIsInverse; }
//!
void SetInverse(const bool theIsInverse) { myIsInverse = theIsInverse; }
private:
bool myIsInverse; //!
NCollection_Array1<double> myTimeStamps; //!<
};
#endif // _XCAFAnimObjects_Operation_HeaderFile

View File

@ -0,0 +1,29 @@
// Copyright (c) 2023 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.
#ifndef _XCAFAnimObjects_OperationType_HeaderFile
#define _XCAFAnimObjects_OperationType_HeaderFile
//!
enum XCAFAnimObjects_OperationType
{
XCAFAnimObjects_OperationType_Custom = 0, //!<
XCAFAnimObjects_OperationType_Orient, //!<
XCAFAnimObjects_OperationType_Rotate, //!<
XCAFAnimObjects_OperationType_Scale, //!<
XCAFAnimObjects_OperationType_Skew, //!<
XCAFAnimObjects_OperationType_Transform, //!<
XCAFAnimObjects_OperationType_Translate //!<
};
#endif // _XCAFAnimObjects_OperationType_HeaderFile

View File

@ -0,0 +1,36 @@
// Copyright (c) 2023 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 <XCAFAnimObjects_Orient.hxx>
//=======================================================================
//function : XCAFAnimObjects_Orient
//purpose :
//=======================================================================
XCAFAnimObjects_Orient::XCAFAnimObjects_Orient(const gp_Quaternion& theOrient) :
XCAFAnimObjects_Operation(false),
myOrientPresentation(1,1)
{
myOrientPresentation.SetValue(1, theOrient);
}
//=======================================================================
//function : XCAFAnimObjects_Orient
//purpose :
//=======================================================================
XCAFAnimObjects_Orient::XCAFAnimObjects_Orient(const NCollection_Array1<gp_Quaternion>& theOrient,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myOrientPresentation(theOrient)
{}

View File

@ -0,0 +1,43 @@
// Copyright (c) 2023 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.
#ifndef _XCAFAnimObjects_Orient_HeaderFile
#define _XCAFAnimObjects_Orient_HeaderFile
#include <XCAFAnimObjects_Operation.hxx>
#include <gp_Quaternion.hxx>
//!
class XCAFAnimObjects_Orient : public XCAFAnimObjects_Operation
{
public:
//!
Standard_EXPORT XCAFAnimObjects_Orient(const gp_Quaternion& theOrient);
//!
Standard_EXPORT XCAFAnimObjects_Orient(const NCollection_Array1<gp_Quaternion>& theOrient,
const NCollection_Array1<double>& theTimeStamps);
//!
XCAFAnimObjects_OperationType GetType() const Standard_OVERRIDE { return XCAFAnimObjects_OperationType_Orient; }
//!
const NCollection_Array1<gp_Quaternion>& OrientPresentation() const { return myOrientPresentation; }
private:
NCollection_Array1<gp_Quaternion> myOrientPresentation; //!<
};
#endif // _XCAFAnimObjects_Orient_HeaderFile

View File

@ -0,0 +1,54 @@
// Copyright (c) 2023 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 "XCAFAnimObjects_Rotate.hxx"
//=======================================================================
//function : XCAFAnimObjects_Rotate
//purpose :
//=======================================================================
XCAFAnimObjects_Rotate::XCAFAnimObjects_Rotate(const gp_Quaternion& theRotate) :
XCAFAnimObjects_Operation(false),
myRotatePresentation(1, 1)
{
myRotatePresentation.SetValue(1, theRotate);
}
//=======================================================================
//function : XCAFAnimObjects_Rotate
//purpose :
//=======================================================================
XCAFAnimObjects_Rotate::XCAFAnimObjects_Rotate(const gp_XYZ& theRotate) :
XCAFAnimObjects_Operation(false),
myRotatePresentation(1, 1)
{
// Convert angles from degrees to radians and create quaternions for each rotation.
gp_Quaternion aQuaternionX(gp_Dir(1, 0, 0), theRotate.X() * M_PI / 180.0);
gp_Quaternion aQuaternionY(gp_Dir(0, 1, 0), theRotate.Y() * M_PI / 180.0);
gp_Quaternion aQuaternionZ(gp_Dir(0, 0, 1), theRotate.Z() * M_PI / 180.0);
// Combine the rotations. The order depends on the rotation order in the original Euler angles.
gp_Quaternion aCombinedQuaternion = aQuaternionX * aQuaternionY * aQuaternionZ;
myRotatePresentation.SetValue(1, aCombinedQuaternion);
}
//=======================================================================
//function : XCAFAnimObjects_Rotate
//purpose :
//=======================================================================
XCAFAnimObjects_Rotate::XCAFAnimObjects_Rotate(const NCollection_Array1<gp_Quaternion>& theRotate,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myRotatePresentation(theRotate)
{}

View File

@ -0,0 +1,46 @@
// Copyright (c) 2023 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.
#ifndef _XCAFAnimObjects_Rotate_HeaderFile
#define _XCAFAnimObjects_Rotate_HeaderFile
#include <XCAFAnimObjects_Operation.hxx>
#include <gp_Quaternion.hxx>
//!
class XCAFAnimObjects_Rotate : public XCAFAnimObjects_Operation
{
public:
//!
Standard_EXPORT XCAFAnimObjects_Rotate(const gp_Quaternion& theRotate);
//!
Standard_EXPORT XCAFAnimObjects_Rotate(const gp_XYZ& theRotate);
//!
Standard_EXPORT XCAFAnimObjects_Rotate(const NCollection_Array1<gp_Quaternion>& theRotate,
const NCollection_Array1<double>& theTimeStamps);
//!
XCAFAnimObjects_OperationType GetType() const Standard_OVERRIDE { return XCAFAnimObjects_OperationType_Rotate; }
//!
const NCollection_Array1<gp_Quaternion>& RotatePresentation() const { return myRotatePresentation; }
private:
NCollection_Array1<gp_Quaternion> myRotatePresentation; //!<
};
#endif // _XCAFAnimObjects_Rotate_HeaderFile

View File

@ -0,0 +1,35 @@
// Copyright (c) 2023 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 "XCAFAnimObjects_Scale.hxx"
//=======================================================================
//function : XCAFAnimObjects_Scale
//purpose :
//=======================================================================
XCAFAnimObjects_Scale::XCAFAnimObjects_Scale(const gp_XYZ& theScale) :
XCAFAnimObjects_Operation(false),
myScalePresentation(1, 1)
{
myScalePresentation.SetValue(1, theScale);
}
//=======================================================================
//function : XCAFAnimObjects_Scale
//purpose :
//=======================================================================
XCAFAnimObjects_Scale::XCAFAnimObjects_Scale(const NCollection_Array1<gp_XYZ>& theScale,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myScalePresentation(theScale)
{}

View File

@ -0,0 +1,43 @@
// Copyright (c) 2023 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.
#ifndef _XCAFAnimObjects_Scale_HeaderFile
#define _XCAFAnimObjects_Scale_HeaderFile
#include <XCAFAnimObjects_Operation.hxx>
#include <gp_XYZ.hxx>
//!
class XCAFAnimObjects_Scale : public XCAFAnimObjects_Operation
{
public:
//!
Standard_EXPORT XCAFAnimObjects_Scale(const gp_XYZ& theScale);
//!
Standard_EXPORT XCAFAnimObjects_Scale(const NCollection_Array1<gp_XYZ>& theScale,
const NCollection_Array1<double>& theTimeStamps);
//!
XCAFAnimObjects_OperationType GetType() const Standard_OVERRIDE { return XCAFAnimObjects_OperationType_Scale; }
//!
const NCollection_Array1<gp_XYZ>& ScalePresentation() const { return myScalePresentation; }
private:
NCollection_Array1<gp_XYZ> myScalePresentation; //!<
};
#endif // _XCAFAnimObjects_Scale_HeaderFile

View File

@ -0,0 +1,35 @@
// Copyright (c) 2023 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 "XCAFAnimObjects_Skew.hxx"
//=======================================================================
//function : XCAFAnimObjects_Skew
//purpose :
//=======================================================================
XCAFAnimObjects_Skew::XCAFAnimObjects_Skew(const Skew& theSkew) :
XCAFAnimObjects_Operation(false),
mySkewPresentation(1, 1)
{
mySkewPresentation.SetValue(1, theSkew);
}
//=======================================================================
//function : XCAFAnimObjects_Skew
//purpose :
//=======================================================================
XCAFAnimObjects_Skew::XCAFAnimObjects_Skew(const NCollection_Array1<Skew>& theSkew,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
mySkewPresentation(theSkew)
{}

View File

@ -0,0 +1,52 @@
// Copyright (c) 2023 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.
#ifndef _XCAFAnimObjects_Skew_HeaderFile
#define _XCAFAnimObjects_Skew_HeaderFile
#include <XCAFAnimObjects_Operation.hxx>
#include <gp_Quaternion.hxx>
#include <gp_Ax3.hxx>
//!
class XCAFAnimObjects_Skew : public XCAFAnimObjects_Operation
{
public:
//!
struct Skew
{
double Angle = 0.; //!<
gp_Dir Axis1; //!<
gp_Dir Axis2; //!<
};
//!
Standard_EXPORT XCAFAnimObjects_Skew(const Skew& theSkew);
//!
Standard_EXPORT XCAFAnimObjects_Skew(const NCollection_Array1<Skew>& theSkew,
const NCollection_Array1<double>& theTimeStamps);
//!
XCAFAnimObjects_OperationType GetType() const Standard_OVERRIDE { return XCAFAnimObjects_OperationType_Skew; }
//!
const NCollection_Array1<Skew>& SkewPresentation() const { return mySkewPresentation; }
private:
NCollection_Array1<Skew> mySkewPresentation; //!<
};
#endif // _XCAFAnimObjects_Skew_HeaderFile

View File

@ -0,0 +1,35 @@
// Copyright (c) 2023 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 "XCAFAnimObjects_Transform.hxx"
//=======================================================================
//function : XCAFAnimObjects_Transform
//purpose :
//=======================================================================
XCAFAnimObjects_Transform::XCAFAnimObjects_Transform(const gp_GTrsf& theTransform) :
XCAFAnimObjects_Operation(false),
myTransformPresentation(1, 1)
{
myTransformPresentation.SetValue(1, theTransform);
}
//=======================================================================
//function : XCAFAnimObjects_Transform
//purpose :
//=======================================================================
XCAFAnimObjects_Transform::XCAFAnimObjects_Transform(const NCollection_Array1<gp_GTrsf>& theTransform,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myTransformPresentation(theTransform)
{}

View File

@ -0,0 +1,43 @@
// Copyright (c) 2023 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.
#ifndef _XCAFAnimObjects_Transform_HeaderFile
#define _XCAFAnimObjects_Transform_HeaderFile
#include <XCAFAnimObjects_Operation.hxx>
#include <gp_GTrsf.hxx>
//!
class XCAFAnimObjects_Transform : public XCAFAnimObjects_Operation
{
public:
//!
Standard_EXPORT XCAFAnimObjects_Transform(const gp_GTrsf& theTransform);
//!
Standard_EXPORT XCAFAnimObjects_Transform(const NCollection_Array1<gp_GTrsf>& theTransform,
const NCollection_Array1<double>& theTimeStamps);
//!
XCAFAnimObjects_OperationType GetType() const Standard_OVERRIDE { return XCAFAnimObjects_OperationType_Transform; }
//!
const NCollection_Array1<gp_GTrsf>& TransformPresentation() const { return myTransformPresentation; }
private:
NCollection_Array1<gp_GTrsf> myTransformPresentation; //!<
};
#endif // _XCAFAnimObjects_Transform_HeaderFile

View File

@ -0,0 +1,36 @@
// Copyright (c) 2023 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 "XCAFAnimObjects_Translate.hxx"
//=======================================================================
//function : XCAFAnimObjects_Translate
//purpose :
//=======================================================================
XCAFAnimObjects_Translate::XCAFAnimObjects_Translate(const gp_XYZ& theTranslate) :
XCAFAnimObjects_Operation(false),
myTranslatePresentation(1, 1)
{
myTranslatePresentation.SetValue(1, theTranslate);
}
//=======================================================================
//function : XCAFAnimObjects_Translate
//purpose :
//=======================================================================
XCAFAnimObjects_Translate::XCAFAnimObjects_Translate(const NCollection_Array1<gp_XYZ>& theTranslate,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myTranslatePresentation(theTranslate)
{}

View File

@ -0,0 +1,43 @@
// Copyright (c) 2023 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.
#ifndef _XCAFAnimObjects_Translate_HeaderFile
#define _XCAFAnimObjects_Translate_HeaderFile
#include <XCAFAnimObjects_Operation.hxx>
#include <gp_XYZ.hxx>
//!
class XCAFAnimObjects_Translate : public XCAFAnimObjects_Operation
{
public:
//!
Standard_EXPORT XCAFAnimObjects_Translate(const gp_XYZ& theTranslate);
//!
Standard_EXPORT XCAFAnimObjects_Translate(const NCollection_Array1<gp_XYZ>& theTranslate,
const NCollection_Array1<double>& theTimeStamps);
//!
XCAFAnimObjects_OperationType GetType() const Standard_OVERRIDE { return XCAFAnimObjects_OperationType_Translate; }
//!
const NCollection_Array1<gp_XYZ>& TranslatePresentation() const { return myTranslatePresentation; }
private:
NCollection_Array1<gp_XYZ> myTranslatePresentation; //!<
};
#endif // _XCAFAnimObjects_Translate_HeaderFile

View File

@ -2,6 +2,10 @@ FILES
GUID.txt
XCAFDoc.cxx
XCAFDoc.hxx
XCAFDoc_Animation.cxx
XCAFDoc_Animation.hxx
XCAFDoc_AnimationTool.cxx
XCAFDoc_AnimationTool.hxx
XCAFDoc_AssemblyItemId.cxx
XCAFDoc_AssemblyItemId.hxx
XCAFDoc_AssemblyItemRef.cxx

View File

@ -0,0 +1,114 @@
// Copyright (c) 2023 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 <XCAFDoc_Animation.hxx>
#include <TDF_RelocationTable.hxx>
#include <TDF_ChildIterator.hxx>
#include <XCAFDoc.hxx>
#include <TDataStd_TreeNode.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <TDataStd_Integer.hxx>
#include <TDataStd_IntegerArray.hxx>
#include <TDataStd_ExtStringArray.hxx>
#include <TDataStd_Real.hxx>
#include <TDataStd_RealArray.hxx>
#include <TNaming_Builder.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TopoDS.hxx>
#include <XCAFDimTolObjects_DimensionObject.hxx>
#include <TNaming_Tool.hxx>
#include <TDataStd_Name.hxx>
IMPLEMENT_DERIVED_ATTRIBUTE(XCAFDoc_Animation, TDataStd_GenericEmpty)
enum ChildLab
{
ChildLab_Begin = 1,
ChildLab_Type = ChildLab_Begin,
ChildLab_End
};
//=======================================================================
//function : XCAFDoc_Animation
//purpose :
//=======================================================================
XCAFDoc_Animation::XCAFDoc_Animation()
{
}
//=======================================================================
//function : GetID
//purpose :
//=======================================================================
const Standard_GUID& XCAFDoc_Animation::GetID()
{
static Standard_GUID DGTID("58ed092c-44de-11d8-8776-001083004c77");
//static Standard_GUID ID("efd212e9-6dfd-11d4-b9c8-0060b0ee281b");
return DGTID;
//return ID;
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
Handle(XCAFDoc_Animation) XCAFDoc_Animation::Set(const TDF_Label& theLabel)
{
Handle(XCAFDoc_Animation) A;
if (!theLabel.FindAttribute(XCAFDoc_Animation::GetID(), A)) {
A = new XCAFDoc_Animation();
theLabel.AddAttribute(A);
}
return A;
}
//=======================================================================
//function : SetObject
//purpose :
//=======================================================================
void XCAFDoc_Animation::SetObject(const Handle(XCAFAnimObjects_AnimObject)& theObject)
{
Backup();
}
//=======================================================================
//function : GetObject
//purpose :
//=======================================================================
Handle(XCAFAnimObjects_AnimObject) XCAFDoc_Animation::GetObject() const
{
Handle(XCAFAnimObjects_AnimObject) anObj = new XCAFAnimObjects_AnimObject();
return anObj;
}
//=======================================================================
//function : ID
//purpose :
//=======================================================================
const Standard_GUID& XCAFDoc_Animation::ID() const
{
return GetID();
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void XCAFDoc_Animation::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
}

View File

@ -0,0 +1,55 @@
// Copyright (c) 2023 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.
#ifndef _XCAFDoc_Animation_HeaderFile
#define _XCAFDoc_Animation_HeaderFile
#include <TDataStd_GenericEmpty.hxx>
class Standard_GUID;
class TDF_Label;
class XCAFAnimObjects_AnimObject;
// resolve name collisions with WinAPI headers
#ifdef GetObject
#undef GetObject
#endif
//!
class XCAFDoc_Animation : public TDataStd_GenericEmpty
{
public:
Standard_EXPORT XCAFDoc_Animation();
Standard_EXPORT static const Standard_GUID& GetID();
Standard_EXPORT static Handle(XCAFDoc_Animation) Set (const TDF_Label& theLabel);
Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
//! Updates parent's label and its sub-labels with data taken from theDimensionObject.
//! Old data associated with the label will be lost.
Standard_EXPORT void SetObject (const Handle(XCAFAnimObjects_AnimObject)& theDimensionObject);
//! Returns dimension object data taken from the parent's label and its sub-labels.
Standard_EXPORT Handle(XCAFAnimObjects_AnimObject) GetObject() const;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_Animation,TDataStd_GenericEmpty)
};
#endif

View File

@ -0,0 +1,132 @@
// Copyright (c) 2023 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 <XCAFDoc_AnimationTool.hxx>
#include <BRep_Builder.hxx>
#include <gp_Pnt.hxx>
#include <gp_Trsf.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_SequenceOfHAsciiString.hxx>
#include <TDataStd_Name.hxx>
#include <TDataStd_TreeNode.hxx>
#include <TDataStd_UAttribute.hxx>
#include <TDF_Attribute.hxx>
#include <TDF_ChildIDIterator.hxx>
#include <TDF_ChildIterator.hxx>
#include <TDF_Label.hxx>
#include <TDF_LabelMap.hxx>
#include <TDF_LabelSequence.hxx>
#include <TDF_RelocationTable.hxx>
#include <TDF_Tool.hxx>
#include <TDocStd_Document.hxx>
#include <TNaming_Builder.hxx>
#include <TNaming_Tool.hxx>
#include <TopLoc_IndexedMapOfLocation.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfOrientedShape.hxx>
#include <XCAFDoc.hxx>
#include <XCAFDoc_GraphNode.hxx>
#include <XCAFDoc_Location.hxx>
#include <XCAFDoc_ShapeMapTool.hxx>
IMPLEMENT_DERIVED_ATTRIBUTE_WITH_TYPE(XCAFDoc_AnimationTool, TDataStd_GenericEmpty, "xcaf", "AnimationTool")
//=======================================================================
//function : GetID
//purpose :
//=======================================================================
const Standard_GUID& XCAFDoc_AnimationTool::GetID()
{
static Standard_GUID ShapeToolID("9E9914DD-154A-4E17-B89B-3E33CCF67BD0");
return ShapeToolID;
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
Handle(XCAFDoc_AnimationTool) XCAFDoc_AnimationTool::Set(const TDF_Label& theLabel)
{
Handle(XCAFDoc_AnimationTool) anAnimTool;
if (!theLabel.FindAttribute(XCAFDoc_AnimationTool::GetID(), anAnimTool)) {
anAnimTool = new XCAFDoc_AnimationTool();
theLabel.AddAttribute(anAnimTool);
}
return anAnimTool;
}
//=======================================================================
//function : Constructor
//purpose :
//=======================================================================
XCAFDoc_AnimationTool::XCAFDoc_AnimationTool()
{}
//=======================================================================
//function : ID
//purpose :
//=======================================================================
const Standard_GUID& XCAFDoc_AnimationTool::ID() const
{
return GetID();
}
//=======================================================================
//function : BaseLabel
//purpose :
//=======================================================================
TDF_Label XCAFDoc_AnimationTool::BaseLabel() const
{
return Label();
}
//=======================================================================
//function : Dump
//purpose :
//=======================================================================
Standard_OStream& XCAFDoc_AnimationTool::Dump(Standard_OStream& theOStream,
const Standard_Boolean theDepth) const
{
(void)theOStream;
(void)theDepth;
}
//=======================================================================
//function : Dump
//purpose :
//=======================================================================
Standard_OStream& XCAFDoc_AnimationTool::Dump(Standard_OStream& theDumpLog) const
{
TDF_Attribute::Dump(theDumpLog);
Dump(theDumpLog, Standard_False);
return theDumpLog;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void XCAFDoc_AnimationTool::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
(void)theOStream;
(void)theDepth;
}

View File

@ -0,0 +1,83 @@
// Copyright (c) 2023 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.
#ifndef _XCAFDoc_AnimationTool_HeaderFile
#define _XCAFDoc_AnimationTool_HeaderFile
#include <Standard.hxx>
#include <XCAFDoc_DataMapOfShapeLabel.hxx>
#include <Standard_Boolean.hxx>
#include <TDataStd_NamedData.hxx>
#include <TDataStd_GenericEmpty.hxx>
#include <TDF_LabelMap.hxx>
#include <TDF_LabelSequence.hxx>
#include <Standard_Integer.hxx>
#include <Standard_OStream.hxx>
#include <TColStd_SequenceOfHAsciiString.hxx>
#include <TDF_AttributeSequence.hxx>
#include <TopTools_SequenceOfShape.hxx>
class Standard_GUID;
class TDF_Label;
class TopoDS_Shape;
class TopLoc_Location;
class XCAFDoc_GraphNode;
//! A tool to store shapes in an XDE
//! document in the form of assembly structure, and to maintain this structure.
//! Attribute containing Shapes section of DECAF document.
//! Provide tools for management of Shapes section.
//! The API provided by this class allows to work with this
//! structure regardless of its low-level implementation.
//! All the shapes are stored on child labels of a main label which is
//! XCAFDoc_DocumentTool::LabelShapes(). The label for assembly also has
//! sub-labels, each of which represents the instance of
//! another shape in that assembly (component). Such sub-label
//! stores reference to the label of the original shape in the form
//! of TDataStd_TreeNode with GUID XCAFDoc::ShapeRefGUID(), and its
//! location encapsulated into the NamedShape.
//! For correct work with an XDE document, it is necessary to use
//! methods for analysis and methods for working with shapes.
class XCAFDoc_AnimationTool : public TDataStd_GenericEmpty
{
public:
Standard_EXPORT static const Standard_GUID& GetID();
//! Create (if not exist) ShapeTool from XCAFDoc on <L>.
Standard_EXPORT static Handle(XCAFDoc_AnimationTool) Set (const TDF_Label& theLabel);
//! Creates an empty tool
//! Creates a tool to work with a document <Doc>
//! Attaches to label XCAFDoc::LabelShapes()
Standard_EXPORT XCAFDoc_AnimationTool();
//! returns the label under which shapes are stored
Standard_EXPORT TDF_Label BaseLabel() const;
Standard_EXPORT Standard_OStream& Dump (Standard_OStream& theOStream, const Standard_Boolean theDepth) const;
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& theOStream) const Standard_OVERRIDE;
Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_AnimationTool,TDataStd_GenericEmpty)
};
#endif // _XCAFDoc_AnimationTool_HeaderFile

View File

@ -1,6 +1,4 @@
// Created on: 2000-09-08
// Created by: data exchange team
// Copyright (c) 2000-2014 OPEN CASCADE SAS
// Copyright (c) 2000-2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//