mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0027235: Export GDT: Annotation plane and Presentation.
Implement Null_Style STEP type. Implement export of annotation planes and presentation as tessellated geometry. Add tests.
This commit is contained in:
@@ -124,6 +124,9 @@ StepVisual_MechanicalDesignGeometricPresentationArea.cxx
|
||||
StepVisual_MechanicalDesignGeometricPresentationArea.hxx
|
||||
StepVisual_MechanicalDesignGeometricPresentationRepresentation.cxx
|
||||
StepVisual_MechanicalDesignGeometricPresentationRepresentation.hxx
|
||||
StepVisual_NullStyle.hxx
|
||||
StepVisual_NullStyleMember.cxx
|
||||
StepVisual_NullStyleMember.hxx
|
||||
StepVisual_OverRidingStyledItem.cxx
|
||||
StepVisual_OverRidingStyledItem.hxx
|
||||
StepVisual_PlanarBox.cxx
|
||||
|
25
src/StepVisual/StepVisual_NullStyle.hxx
Normal file
25
src/StepVisual/StepVisual_NullStyle.hxx
Normal file
@@ -0,0 +1,25 @@
|
||||
// Created on: 2016-03-09
|
||||
// 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 _StepVisual_NullStyle_HeaderFile
|
||||
#define _StepVisual_NullStyle_HeaderFile
|
||||
|
||||
#include <Standard_PrimitiveTypes.hxx>
|
||||
|
||||
enum StepVisual_NullStyle {
|
||||
StepVisual_Null
|
||||
};
|
||||
|
||||
#endif
|
72
src/StepVisual/StepVisual_NullStyleMember.cxx
Normal file
72
src/StepVisual/StepVisual_NullStyleMember.cxx
Normal file
@@ -0,0 +1,72 @@
|
||||
// Created on: 2015-07-16
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 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 <StepVisual_NullStyleMember.hxx>
|
||||
#include <StepData_EnumTool.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(StepVisual_NullStyleMember,StepData_SelectInt)
|
||||
|
||||
static StepData_EnumTool tool
|
||||
(".NULL.");
|
||||
|
||||
//=======================================================================
|
||||
//function : StepVisual_NullStyleMember
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
StepVisual_NullStyleMember::StepVisual_NullStyleMember () { }
|
||||
|
||||
//=======================================================================
|
||||
//function : EnumText
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_CString StepVisual_NullStyleMember::EnumText () const
|
||||
{
|
||||
return tool.Text(Int()).ToCString();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetEnumText
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void StepVisual_NullStyleMember::SetEnumText (const Standard_Integer /*theValue*/,
|
||||
const Standard_CString theText)
|
||||
{
|
||||
Standard_Integer aVal = tool.Value (theText);
|
||||
if (aVal >= 0) SetInt (aVal);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetValue
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void StepVisual_NullStyleMember::SetValue (const StepVisual_NullStyle theValue)
|
||||
{
|
||||
SetInt ( Standard_Integer (theValue) );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
StepVisual_NullStyle StepVisual_NullStyleMember::Value () const
|
||||
{
|
||||
return StepVisual_NullStyle (Int());
|
||||
}
|
61
src/StepVisual/StepVisual_NullStyleMember.hxx
Normal file
61
src/StepVisual/StepVisual_NullStyleMember.hxx
Normal file
@@ -0,0 +1,61 @@
|
||||
// Created on: 2016-03-09
|
||||
// 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 _StepVisual_NullStyleMember_HeaderFile
|
||||
#define _StepVisual_NullStyleMember_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepData_SelectInt.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <StepVisual_NullStyle.hxx>
|
||||
|
||||
class StepVisual_NullStyleMember;
|
||||
DEFINE_STANDARD_HANDLE(StepVisual_NullStyleMember, StepData_SelectInt)
|
||||
//! Defines NullStyle as unique member of PresentationStyleSelect
|
||||
//! Works with an EnumTool
|
||||
class StepVisual_NullStyleMember : public StepData_SelectInt
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
Standard_EXPORT StepVisual_NullStyleMember();
|
||||
|
||||
virtual Standard_Boolean HasName() const Standard_OVERRIDE
|
||||
{ return Standard_True; }
|
||||
|
||||
virtual Standard_CString Name() const Standard_OVERRIDE
|
||||
{ return "NULL_STYLE"; }
|
||||
|
||||
virtual Standard_Boolean SetName(const Standard_CString /*theName*/) Standard_OVERRIDE
|
||||
{ return Standard_True; }
|
||||
|
||||
Standard_Integer Kind() const Standard_OVERRIDE
|
||||
{return 4;}
|
||||
|
||||
Standard_EXPORT virtual Standard_CString EnumText() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void SetEnumText (const Standard_Integer theValue, const Standard_CString theText) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void SetValue (const StepVisual_NullStyle theValue) ;
|
||||
|
||||
Standard_EXPORT StepVisual_NullStyle Value() const;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(StepVisual_NullStyleMember,StepData_SelectInt)
|
||||
};
|
||||
#endif // _StepVisual_NullStyleMember_HeaderFile
|
@@ -16,6 +16,7 @@
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <StepVisual_CurveStyle.hxx>
|
||||
#include <StepVisual_FillAreaStyle.hxx>
|
||||
#include <StepVisual_NullStyleMember.hxx>
|
||||
#include <StepVisual_PointStyle.hxx>
|
||||
#include <StepVisual_PresentationStyleSelect.hxx>
|
||||
#include <StepVisual_SurfaceStyleUsage.hxx>
|
||||
@@ -32,6 +33,7 @@ Standard_Integer StepVisual_PresentationStyleSelect::CaseNum(const Handle(Standa
|
||||
// if (ent->IsKind(STANDARD_TYPE(StepVisual_SymbolStyle))) return 4;
|
||||
// if (ent->IsKind(STANDARD_TYPE(StepVisual_FillAreaStyle))) return 5;
|
||||
// if (ent->IsKind(STANDARD_TYPE(StepVisual_TextStyle))) return 6;
|
||||
if (ent->IsKind(STANDARD_TYPE(StepVisual_NullStyleMember))) return 7;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -45,6 +47,11 @@ Handle(StepVisual_CurveStyle) StepVisual_PresentationStyleSelect::CurveStyle ()
|
||||
return GetCasted(StepVisual_CurveStyle,Value());
|
||||
}
|
||||
|
||||
Handle(StepVisual_NullStyleMember) StepVisual_PresentationStyleSelect::NullStyle () const
|
||||
{
|
||||
return GetCasted(StepVisual_NullStyleMember,Value());
|
||||
}
|
||||
|
||||
Handle(StepVisual_SurfaceStyleUsage) StepVisual_PresentationStyleSelect::SurfaceStyleUsage () const
|
||||
{
|
||||
return GetCasted(StepVisual_SurfaceStyleUsage,Value());
|
||||
|
@@ -26,6 +26,7 @@
|
||||
class Standard_Transient;
|
||||
class StepVisual_PointStyle;
|
||||
class StepVisual_CurveStyle;
|
||||
class StepVisual_NullStyleMember;
|
||||
class StepVisual_SurfaceStyleUsage;
|
||||
|
||||
|
||||
@@ -47,6 +48,7 @@ public:
|
||||
//! 4 -> SymbolStyle
|
||||
//! 5 -> FillAreaStyle
|
||||
//! 6 -> TextStyle
|
||||
//! 7 -> NullStyle
|
||||
//! 0 else
|
||||
Standard_EXPORT Standard_Integer CaseNum (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
@@ -55,6 +57,9 @@ public:
|
||||
|
||||
//! returns Value as a CurveStyle (Null if another type)
|
||||
Standard_EXPORT Handle(StepVisual_CurveStyle) CurveStyle() const;
|
||||
|
||||
//! returns Value as a NullStyleMember (Null if another type)
|
||||
Standard_EXPORT Handle(StepVisual_NullStyleMember) NullStyle() const;
|
||||
|
||||
//! returns Value as a SurfaceStyleUsage (Null if another type)
|
||||
Standard_EXPORT Handle(StepVisual_SurfaceStyleUsage) SurfaceStyleUsage() const;
|
||||
|
@@ -21,13 +21,13 @@ IMPLEMENT_STANDARD_RTTIEXT(StepVisual_TessellatedGeometricSet,StepGeom_Tessellat
|
||||
|
||||
StepVisual_TessellatedGeometricSet::StepVisual_TessellatedGeometricSet () {}
|
||||
|
||||
void StepVisual_TessellatedGeometricSet::Init(const Handle(TCollection_HAsciiString)& theName, const NCollection_Handle<StepVisual_Array1OfTessellaltedItem>& theItems)
|
||||
void StepVisual_TessellatedGeometricSet::Init(const Handle(TCollection_HAsciiString)& theName, const NCollection_Handle<StepVisual_Array1OfTessellatedItem>& theItems)
|
||||
{
|
||||
StepRepr_RepresentationItem::Init(theName);
|
||||
myItems = theItems;
|
||||
}
|
||||
|
||||
NCollection_Handle<StepVisual_Array1OfTessellaltedItem> StepVisual_TessellatedGeometricSet::Items() const
|
||||
NCollection_Handle<StepVisual_Array1OfTessellatedItem> StepVisual_TessellatedGeometricSet::Items() const
|
||||
{
|
||||
return myItems;
|
||||
}
|
||||
|
@@ -26,10 +26,8 @@
|
||||
|
||||
class Standard_Transient;
|
||||
|
||||
typedef NCollection_Array1<Handle(StepVisual_TessellatedItem)> StepVisual_Array1OfTessellaltedItem;
|
||||
//typedef NCollection_Handle<StepVisual_Array1OfTessellaltedItem> Handle(StepVisual_Array1OfTessellaltedItem);
|
||||
typedef NCollection_Array1<Handle(StepVisual_TessellatedItem)> StepVisual_Array1OfTessellatedItem;
|
||||
|
||||
//DEFINE_HARRAY1(StepVisual_HArray1OfTessellaltedItem, StepVisual_Array1OfTessellaltedItem)
|
||||
DEFINE_STANDARD_HANDLE(StepVisual_TessellatedGeometricSet, StepVisual_TessellatedItem)
|
||||
class StepVisual_TessellatedGeometricSet : public StepVisual_TessellatedItem
|
||||
{
|
||||
@@ -40,12 +38,12 @@ public:
|
||||
//! Returns a DraughtingCalloutElement select type
|
||||
Standard_EXPORT StepVisual_TessellatedGeometricSet();
|
||||
|
||||
Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName, const NCollection_Handle<StepVisual_Array1OfTessellaltedItem>& theItems);
|
||||
Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName, const NCollection_Handle<StepVisual_Array1OfTessellatedItem>& theItems);
|
||||
|
||||
Standard_EXPORT NCollection_Handle<StepVisual_Array1OfTessellaltedItem> Items() const;
|
||||
Standard_EXPORT NCollection_Handle<StepVisual_Array1OfTessellatedItem> Items() const;
|
||||
|
||||
private:
|
||||
NCollection_Handle<StepVisual_Array1OfTessellaltedItem> myItems;
|
||||
NCollection_Handle<StepVisual_Array1OfTessellatedItem> myItems;
|
||||
|
||||
public:
|
||||
|
||||
|
Reference in New Issue
Block a user