mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028044: Data Exchange - implement data structures for Saved Views
Add new root label in Document for Views. Add new attribute to store View in XDE. Add object and tool to process Views. Add new Draw commands for Views.
This commit is contained in:
3
src/XCAFView/FILES
Normal file
3
src/XCAFView/FILES
Normal file
@@ -0,0 +1,3 @@
|
||||
XCAFView_Object.cxx
|
||||
XCAFView_Object.hxx
|
||||
XCAFView_ProjectionType.hxx
|
53
src/XCAFView/XCAFView_Object.cxx
Normal file
53
src/XCAFView/XCAFView_Object.cxx
Normal file
@@ -0,0 +1,53 @@
|
||||
// Created on: 2016-10-20
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2016 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 <XCAFView_Object.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(XCAFView_Object,Standard_Transient)
|
||||
|
||||
//=======================================================================
|
||||
//function : XCAFView_Object
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
XCAFView_Object::XCAFView_Object()
|
||||
{
|
||||
myHasClippingPlane = Standard_False;
|
||||
myFrontPlaneClipping = Standard_False;
|
||||
myBackPlaneClipping = Standard_False;
|
||||
myViewVolumeSidesClipping = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : XCAFView_Object
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
XCAFView_Object::XCAFView_Object(const Handle(XCAFView_Object)& theObj)
|
||||
{
|
||||
|
||||
myType = theObj->myType;
|
||||
myProjectionPoint = theObj->myProjectionPoint;
|
||||
myViewDirection = theObj->myViewDirection;
|
||||
myUpDirection = theObj->myUpDirection;
|
||||
myZoomFactor = theObj->myZoomFactor;
|
||||
myWindowHorizontalSize = theObj->myWindowHorizontalSize;
|
||||
myWindowVerticalSize = theObj->myWindowVerticalSize;
|
||||
myHasClippingPlane = theObj->myHasClippingPlane;
|
||||
myClippingPlane = theObj->myClippingPlane;
|
||||
myFrontPlaneClipping = theObj->myFrontPlaneClipping;
|
||||
myFrontPlaneDistance = theObj->myFrontPlaneDistance;
|
||||
myBackPlaneClipping = theObj->myBackPlaneClipping;
|
||||
myBackPlaneDistance = theObj->myBackPlaneDistance;
|
||||
myViewVolumeSidesClipping = theObj->myViewVolumeSidesClipping;
|
||||
}
|
217
src/XCAFView/XCAFView_Object.hxx
Normal file
217
src/XCAFView/XCAFView_Object.hxx
Normal file
@@ -0,0 +1,217 @@
|
||||
// Created on: 2016-10-20
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2016 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 _XCAFView_Object_HeaderFile
|
||||
#define _XCAFView_Object_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <XCAFView_ProjectionType.hxx>
|
||||
|
||||
class XCAFView_Object;
|
||||
DEFINE_STANDARD_HANDLE(XCAFView_Object, Standard_Transient)
|
||||
|
||||
//! object to store view
|
||||
class XCAFView_Object : public Standard_Transient
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
Standard_EXPORT XCAFView_Object();
|
||||
|
||||
Standard_EXPORT XCAFView_Object(const Handle(XCAFView_Object)& theObj);
|
||||
|
||||
Standard_EXPORT void SetName(Handle(TCollection_HAsciiString) theName)
|
||||
{
|
||||
myName = theName;
|
||||
}
|
||||
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) Name()
|
||||
{
|
||||
return myName;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetType(XCAFView_ProjectionType theType)
|
||||
{
|
||||
myType = theType;
|
||||
}
|
||||
|
||||
Standard_EXPORT XCAFView_ProjectionType Type()
|
||||
{
|
||||
return myType;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetProjectionPoint(gp_Pnt thePoint)
|
||||
{
|
||||
myProjectionPoint = thePoint;
|
||||
}
|
||||
|
||||
Standard_EXPORT gp_Pnt ProjectionPoint()
|
||||
{
|
||||
return myProjectionPoint;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetViewDirection(gp_Dir theDirection)
|
||||
{
|
||||
myViewDirection = theDirection;
|
||||
}
|
||||
|
||||
Standard_EXPORT gp_Dir ViewDirection()
|
||||
{
|
||||
return myViewDirection;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetUpDirection(gp_Dir theDirection)
|
||||
{
|
||||
myUpDirection = theDirection;
|
||||
}
|
||||
|
||||
Standard_EXPORT gp_Dir UpDirection()
|
||||
{
|
||||
return myUpDirection;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetZoomFactor(Standard_Real theZoomFactor)
|
||||
{
|
||||
myZoomFactor = theZoomFactor;
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Real ZoomFactor()
|
||||
{
|
||||
return myZoomFactor;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetWindowHorizontalSize(Standard_Real theSize)
|
||||
{
|
||||
myWindowHorizontalSize = theSize;
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Real WindowHorizontalSize()
|
||||
{
|
||||
return myWindowHorizontalSize;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetWindowVerticalSize(Standard_Real theSize)
|
||||
{
|
||||
myWindowVerticalSize = theSize;
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Real WindowVerticalSize()
|
||||
{
|
||||
return myWindowVerticalSize;
|
||||
}
|
||||
|
||||
Standard_EXPORT void UnsetClippingPlane()
|
||||
{
|
||||
myHasClippingPlane = Standard_False;
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasClippingPlane()
|
||||
{
|
||||
return myHasClippingPlane;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetClippingPlane(gp_Pln thePlane)
|
||||
{
|
||||
myClippingPlane = thePlane;
|
||||
myHasClippingPlane = Standard_True;
|
||||
}
|
||||
|
||||
Standard_EXPORT gp_Pln ClippingPlane()
|
||||
{
|
||||
return myClippingPlane;
|
||||
}
|
||||
|
||||
Standard_EXPORT void UnsetFrontPlaneClipping()
|
||||
{
|
||||
myFrontPlaneClipping = Standard_False;
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasFrontPlaneClipping()
|
||||
{
|
||||
return myFrontPlaneClipping;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetFrontPlaneDistance(Standard_Real theDistance)
|
||||
{
|
||||
myFrontPlaneDistance = theDistance;
|
||||
myFrontPlaneClipping = Standard_True;
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Real FrontPlaneDistance()
|
||||
{
|
||||
return myFrontPlaneDistance;
|
||||
}
|
||||
|
||||
Standard_EXPORT void UnsetBackPlaneClipping()
|
||||
{
|
||||
myBackPlaneClipping = Standard_False;
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasBackPlaneClipping()
|
||||
{
|
||||
return myBackPlaneClipping;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetBackPlaneDistance(Standard_Real theDistance)
|
||||
{
|
||||
myBackPlaneDistance = theDistance;
|
||||
myBackPlaneClipping = Standard_True;
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Real BackPlaneDistance()
|
||||
{
|
||||
return myBackPlaneDistance;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetViewVolumeSidesClipping(Standard_Boolean theViewVolumeSidesClipping)
|
||||
{
|
||||
myViewVolumeSidesClipping = theViewVolumeSidesClipping;
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasViewVolumeSidesClipping()
|
||||
{
|
||||
return myViewVolumeSidesClipping;
|
||||
}
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(XCAFView_Object,Standard_Transient)
|
||||
|
||||
private:
|
||||
|
||||
Handle(TCollection_HAsciiString) myName;
|
||||
XCAFView_ProjectionType myType;
|
||||
gp_Pnt myProjectionPoint;
|
||||
gp_Dir myViewDirection;
|
||||
gp_Dir myUpDirection;
|
||||
Standard_Real myZoomFactor;
|
||||
Standard_Real myWindowHorizontalSize;
|
||||
Standard_Real myWindowVerticalSize;
|
||||
Standard_Boolean myHasClippingPlane;
|
||||
gp_Pln myClippingPlane;
|
||||
Standard_Boolean myFrontPlaneClipping;
|
||||
Standard_Real myFrontPlaneDistance;
|
||||
Standard_Boolean myBackPlaneClipping;
|
||||
Standard_Real myBackPlaneDistance;
|
||||
Standard_Boolean myViewVolumeSidesClipping;
|
||||
|
||||
};
|
||||
|
||||
#endif // _XCAFView_Object_HeaderFile
|
28
src/XCAFView/XCAFView_ProjectionType.hxx
Normal file
28
src/XCAFView/XCAFView_ProjectionType.hxx
Normal file
@@ -0,0 +1,28 @@
|
||||
// Created on: 2016-10-20
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2016 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 _XCAFView_ProjectionType_HeaderFile
|
||||
#define _XCAFView_ProjectionType_HeaderFile
|
||||
|
||||
//! Defines projection types of view
|
||||
enum XCAFView_ProjectionType
|
||||
{
|
||||
XCAFView_ProjectionType_NoCamera,
|
||||
XCAFView_ProjectionType_Parallel,
|
||||
XCAFView_ProjectionType_Central
|
||||
};
|
||||
|
||||
#endif // _XCAFView_ProjectionType_HeaderFile
|
Reference in New Issue
Block a user