1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

Compare commits

...

5 Commits

Author SHA1 Message Date
vpa
7de1505cd7 0026905: Visualization - cosmetic fixes in selection methods of AIS_InteractiveContext
- selection mode in AIS_InteractiveContext::AddOrRemoveSelected is corrected;
- AIS_InteractiveContext::IsSelected returns object's state instead of global status.
2015-11-20 14:49:21 +03:00
ika
76644dfc05 small corrections 2015-11-12 16:14:47 +03:00
ika
c319c581aa 0026827: Position and orientation for GD&T frames
Add STEP entities:
- StepAP242_DraughtingModelItemAssociation
- StepVisual_AnnotationOccurrence
- StepVisual_AnnotationCurveOccurrence
- StepVisual_AnnotationPlane
- StepVisual_DraughtingCallout
- StepVisual_AnnotationPlaneElement
- StepVisual_DraughtingCalloutElement

Changed the structure of XCAF to save the position of PMI data.

Add function to read orientation of GDT frame and connection point and set them to XCAF.
2015-11-12 16:14:39 +03:00
apl
626a5c40da 0026792: Visualization, Graphic3d - Z-fit support for transform persistence is missing after removing Visual3d_View
Add missing code for z-fit support for zoom, rotate persistent object.
Fixed wrong statement that should enable frustum culling optimization for zoom, rotate persistent object.
Added non-regression test case for z-clipping of transform persistent objects.
2015-11-12 16:14:05 +03:00
isk
052de8cc0d 0026821: Visualization - define default Rendering Parameters for Interactive Context
Define default Rendering Parameters within V3d_Viewer.
New instances of V3d_View use default Rendering Parameters.
2015-11-12 16:12:43 +03:00
52 changed files with 2252 additions and 92 deletions

View File

@@ -1023,16 +1023,20 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(AIS_InteractiveObject)& theObject,
const Standard_Boolean theToUpdateViewer)
{
if (!theObject->HasInteractiveContext())
theObject->SetContext (this);
if (theObject.IsNull())
return;
if (HasOpenedContext())
return myLocalContexts (myCurLocalIndex)->AddOrRemoveSelected (theObject, theToUpdateViewer);
if (theObject.IsNull() || !myObjects.IsBound (theObject) || !theObject->HasSelection (0))
const Standard_Integer aGlobalSelMode = theObject->GlobalSelectionMode();
if (!myObjects.IsBound (theObject) || !theObject->HasSelection (aGlobalSelMode))
return;
const Handle(SelectMgr_Selection)& aSel = theObject->Selection (0);
if (!theObject->HasInteractiveContext())
theObject->SetContext (this);
const Handle(SelectMgr_Selection)& aSel = theObject->Selection (aGlobalSelMode);
if (aSel->IsEmpty())
return;
@@ -1139,10 +1143,10 @@ Standard_Boolean AIS_InteractiveContext::IsSelected (const Handle(AIS_Interactiv
break;
}
}
if (!theObj->HasSelection (aGlobalSelMode) || !isGlobalModeActivated)
if (!theObj->HasSelection (aGlobalSelMode) || !isGlobalModeActivated || theObj->GlobalSelOwner().IsNull())
return Standard_False;
return myObjects (theObj)->IsHilighted();
return theObj->GlobalSelOwner()->State() == 1;
}
//=======================================================================

View File

@@ -401,53 +401,6 @@ void Graphic3d_CView::DisplayedStructures (Graphic3d_MapOfStructure& theStructur
}
}
//! Auxiliary method for MinMaxValues() method
inline void addStructureBndBox (const Handle(Graphic3d_Structure)& theStruct,
const Standard_Boolean theToIgnoreInfiniteFlag,
Bnd_Box& theBndBox)
{
if (!theStruct->IsVisible())
{
return;
}
else if (theStruct->IsInfinite()
&& !theToIgnoreInfiniteFlag)
{
// XMin, YMin .... ZMax are initialized by means of infinite line data
const Bnd_Box aBox = theStruct->MinMaxValues (Standard_False);
if (!aBox.IsWhole()
&& !aBox.IsVoid())
{
theBndBox.Add (aBox);
}
return;
}
// Only non-empty and non-infinite structures
// are taken into account for calculation of MinMax
if (theStruct->IsEmpty()
|| theStruct->TransformPersistenceMode() != Graphic3d_TMF_None)
{
return;
}
// "FitAll" operation ignores object with transform persistence parameter
const Bnd_Box aBox = theStruct->MinMaxValues (theToIgnoreInfiniteFlag);
// To prevent float overflow at camera parameters calculation and further
// rendering, bounding boxes with at least one vertex coordinate out of
// float range are skipped by view fit algorithms
if (Abs (aBox.CornerMax().X()) >= ShortRealLast() ||
Abs (aBox.CornerMax().Y()) >= ShortRealLast() ||
Abs (aBox.CornerMax().Z()) >= ShortRealLast() ||
Abs (aBox.CornerMin().X()) >= ShortRealLast() ||
Abs (aBox.CornerMin().Y()) >= ShortRealLast() ||
Abs (aBox.CornerMin().Z()) >= ShortRealLast())
return;
theBndBox.Add (aBox);
}
// =======================================================================
// function : MinMaxValues
// purpose :
@@ -472,20 +425,69 @@ Bnd_Box Graphic3d_CView::MinMaxValues (const Graphic3d_MapOfStructure& theSet,
{
Bnd_Box aResult;
const Standard_Integer aViewId = Identification();
Handle(Graphic3d_Camera) aCamera = Camera();
Standard_Integer aWinWidth = 0;
Standard_Integer aWinHeight = 0;
if (IsDefined())
{
Window()->Size (aWinWidth, aWinHeight);
}
for (Graphic3d_MapIteratorOfMapOfStructure aStructIter (theSet); aStructIter.More(); aStructIter.Next())
{
const Handle(Graphic3d_Structure)& aStructure = aStructIter.Key();
if (!aStructIter.Value()->IsVisible())
if (!aStructure->IsVisible() || aStructure->IsEmpty())
{
continue;
}
else if (!aStructIter.Value()->CStructure()->ViewAffinity.IsNull()
&& !aStructIter.Value()->CStructure()->ViewAffinity->IsVisible (aViewId))
else if (!aStructure->CStructure()->ViewAffinity.IsNull()
&& !aStructure->CStructure()->ViewAffinity->IsVisible (aViewId))
{
continue;
}
addStructureBndBox (aStructure, theToIgnoreInfiniteFlag, aResult);
// "FitAll" operation ignores object with transform persistence parameter
if (aStructure->TransformPersistence().Flags)
{
// Panning and 2d persistence apply changes to projection or/and its translation components.
// It makes them incompatible with z-fitting algorithm. Ignored by now.
if (!theToIgnoreInfiniteFlag ||
(aStructure->TransformPersistence().Flags & Graphic3d_TMF_2d) ||
(aStructure->TransformPersistence().Flags & Graphic3d_TMF_PanPers))
{
continue;
}
}
Bnd_Box aBox = aStructure->MinMaxValues (theToIgnoreInfiniteFlag);
if (aBox.IsWhole() || aBox.IsVoid())
{
continue;
}
if (aStructure->TransformPersistence().Flags != Graphic3d_TMF_None)
{
const Graphic3d_Mat4d& aProjectionMat = aCamera->ProjectionMatrix();
const Graphic3d_Mat4d& aWorldViewMat = aCamera->OrientationMatrix();
aStructure->TransformPersistence().Apply (aProjectionMat, aWorldViewMat, aWinWidth, aWinHeight, aBox);
}
// To prevent float overflow at camera parameters calculation and further
// rendering, bounding boxes with at least one vertex coordinate out of
// float range are skipped by view fit algorithms
if (Abs (aBox.CornerMax().X()) >= ShortRealLast() ||
Abs (aBox.CornerMax().Y()) >= ShortRealLast() ||
Abs (aBox.CornerMax().Z()) >= ShortRealLast() ||
Abs (aBox.CornerMin().X()) >= ShortRealLast() ||
Abs (aBox.CornerMin().Y()) >= ShortRealLast() ||
Abs (aBox.CornerMin().Z()) >= ShortRealLast())
{
continue;
}
aResult.Add (aBox);
}
return aResult;
}

View File

@@ -163,7 +163,8 @@ public:
|| IsForHighlight
|| IsMutable
|| Is2dText
|| TransformPersistence.Flags != 0;
|| (TransformPersistence.Flags & Graphic3d_TMF_2d) != 0
|| (TransformPersistence.Flags & Graphic3d_TMF_PanPers) != 0;
}
//! This method releases GL resources without actual elements destruction.

View File

@@ -1268,6 +1268,11 @@
#include <RWStepRepr_RWCompShAspAndDatumFeatAndShAsp.hxx>
#include <RWStepRepr_RWIntegerRepresentationItem.hxx>
#include <RWStepRepr_RWValueRepresentationItem.hxx>
#include <RWStepAP242_RWDraughtingModelItemAssociation.hxx>
#include <RWStepVisual_RWAnnotationCurveOccurrence.hxx>
#include <RWStepVisual_RWAnnotationOccurrence.hxx>
#include <RWStepVisual_RWAnnotationPlane.hxx>
#include <RWStepVisual_RWDraughtingCallout.hxx>
#include <StepRepr_Apex.hxx>
#include <StepRepr_CentreOfSymmetry.hxx>
@@ -1311,6 +1316,10 @@
#include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
#include <StepRepr_IntegerRepresentationItem.hxx>
#include <StepRepr_ValueRepresentationItem.hxx>
#include <StepAP242_DraughtingModelItemAssociation.hxx>
#include <StepVisual_AnnotationCurveOccurrence.hxx>
#include <StepVisual_AnnotationPlane.hxx>
#include <StepVisual_DraughtingCallout.hxx>
static Standard_Integer catsh,catdr,catstr,catdsc,cataux;
@@ -1387,10 +1396,17 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
tool.Share(anent,iter);
}
break;
case 4:
{
DeclareAndCast(StepVisual_AnnotationCurveOccurrence,anent,ent);
RWStepVisual_RWAnnotationCurveOccurrence tool;
tool.Share(anent,iter);
}
break;
case 7:
{
DeclareAndCast(StepVisual_StyledItem,anent,ent);
RWStepVisual_RWStyledItem tool;
DeclareAndCast(StepVisual_AnnotationOccurrence,anent,ent);
RWStepVisual_RWAnnotationOccurrence tool;
tool.Share(anent,iter);
}
break;
@@ -1859,6 +1875,13 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
tool.Share(anent,iter);
}
break;
case 107:
{
DeclareAndCast(StepVisual_DraughtingCallout,anent,ent);
RWStepVisual_RWDraughtingCallout tool;
tool.Share(anent,iter);
}
break;
case 116:
{
DeclareAndCast(StepShape_EdgeCurve,anent,ent);
@@ -4978,6 +5001,21 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
RWStepRepr_RWFeatureForDatumTargetRelationship tool;
tool.Share(anent,iter);
}
break;
case 703:
{
DeclareAndCast(StepAP242_DraughtingModelItemAssociation,anent,ent);
RWStepAP242_RWDraughtingModelItemAssociation tool;
tool.Share(anent,iter);
}
break;
case 704:
{
DeclareAndCast(StepVisual_AnnotationPlane,anent,ent);
RWStepVisual_RWAnnotationPlane tool;
tool.Share(anent,iter);
}
break;
default : break;
}
@@ -5132,6 +5170,9 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
case 3 :
ent = new StepShape_AdvancedFace;
break;
case 4 :
ent = new StepVisual_AnnotationCurveOccurrence;
break;
case 7 :
ent = new StepVisual_AnnotationOccurrence;
break;
@@ -5393,6 +5434,9 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
case 106 :
ent = new StepVisual_AnnotationOccurrence;
break;
case 107 :
ent = new StepVisual_DraughtingCallout;
break;
case 108 :
ent = new StepVisual_DraughtingPreDefinedColour;
break;
@@ -6928,6 +6972,12 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
case 702:
ent = new StepRepr_FeatureForDatumTargetRelationship;
break;
case 703:
ent = new StepAP242_DraughtingModelItemAssociation;
break;
case 704:
ent = new StepVisual_AnnotationPlane;
break;
default:
return Standard_False;
@@ -7508,7 +7558,10 @@ Standard_Integer RWStepAP214_GeneralModule::CategoryNumber
case 698:
case 699:
case 700:
case 701: return catdr;
case 701:
case 702:
case 703:
case 704: return catdr;
default : break;
}

View File

@@ -1316,6 +1316,13 @@ Handle(atype) result = Handle(atype)::DownCast (start)
#include <RWStepRepr_RWCompShAspAndDatumFeatAndShAsp.hxx>
#include <RWStepRepr_RWIntegerRepresentationItem.hxx>
#include <RWStepRepr_RWValueRepresentationItem.hxx>
#include <RWStepRepr_RWValueRepresentationItem.hxx>
#include <RWStepAP242_RWDraughtingModelItemAssociation.hxx>
#include <RWStepVisual_RWAnnotationCurveOccurrence.hxx>
#include <RWStepVisual_RWAnnotationOccurrence.hxx>
#include <RWStepVisual_RWAnnotationPlane.hxx>
#include <RWStepVisual_RWDraughtingCallout.hxx>
#include <StepRepr_Apex.hxx>
#include <StepRepr_CentreOfSymmetry.hxx>
@@ -1359,6 +1366,11 @@ Handle(atype) result = Handle(atype)::DownCast (start)
#include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
#include <StepRepr_IntegerRepresentationItem.hxx>
#include <StepRepr_ValueRepresentationItem.hxx>
#include <StepAP242_DraughtingModelItemAssociation.hxx>
#include <StepVisual_AnnotationCurveOccurrence.hxx>
#include <StepVisual_AnnotationPlane.hxx>
#include <StepVisual_DraughtingCallout.hxx>
// -- General Declarations (Recognize, StepType) ---
@@ -1987,6 +1999,9 @@ static TCollection_AsciiString Reco_DatumSystem("DATUM_SYSTEM");
static TCollection_AsciiString Reco_GeneralDatumReference("GENERAL_DATUM_REFERENCE");
static TCollection_AsciiString Reco_IntegerRepresentationItem("INTEGER_REPRESENTATION_ITEM");
static TCollection_AsciiString Reco_ValueRepresentationItem("VALUE_REPRESENTATION_ITEM");
static TCollection_AsciiString Reco_FeatureForDatumTargetRelationship("FEARURE_FOR_DATUM_TARGET_RELATIONSHIP");
static TCollection_AsciiString Reco_DraughtingModelItemAssociation("DRAUGHTING_MODEL_ITEM_ASSOCIATION");
static TCollection_AsciiString Reco_AnnotationPlane("ANNOTATION_PLANE");
// -- Definition of the libraries --
@@ -2630,6 +2645,9 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
typenums->SetItem (Reco_GeneralDatumReference, 690);
typenums->SetItem (Reco_IntegerRepresentationItem, 700);
typenums->SetItem (Reco_ValueRepresentationItem, 701);
typenums->SetItem (Reco_FeatureForDatumTargetRelationship, 702);
typenums->SetItem (Reco_DraughtingModelItemAssociation, 703);
typenums->SetItem (Reco_AnnotationPlane, 704);
// SHORT NAMES
// NB : la liste est celle de AP203
@@ -3168,6 +3186,8 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
typeshor->SetItem ("TLZNFR",684);
typeshor->SetItem ("INRPIT",700);
typeshor->SetItem ("VLRPIT",701);
typeshor->SetItem ("DMIA", 703);
typeshor->SetItem ("ANNPLN", 704);
}
@@ -4383,6 +4403,9 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType
case 690: return Reco_GeneralDatumReference;
case 700: return Reco_IntegerRepresentationItem;
case 701: return Reco_ValueRepresentationItem;
case 702: return Reco_FeatureForDatumTargetRelationship;
case 703: return Reco_DraughtingModelItemAssociation;
case 704: return Reco_AnnotationPlane;
default : return PasReco;
}
@@ -4723,11 +4746,17 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
tool.ReadStep (data,num,ach,anent);
}
break;
case 4 :
{
DeclareAndCast(StepVisual_AnnotationCurveOccurrence, anent, ent);
RWStepVisual_RWAnnotationCurveOccurrence tool;
tool.ReadStep (data,num,ach,anent);
}
break;
case 7 :
{
DeclareAndCast(StepVisual_StyledItem, anent, ent);
RWStepVisual_RWStyledItem tool;
DeclareAndCast(StepVisual_AnnotationOccurrence, anent, ent);
RWStepVisual_RWAnnotationOccurrence tool;
tool.ReadStep (data,num,ach,anent);
}
@@ -5418,6 +5447,13 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
tool.ReadStep (data,num,ach,anent);
}
break;
case 107 :
{
DeclareAndCast(StepVisual_DraughtingCallout, anent, ent);
RWStepVisual_RWDraughtingCallout tool;
tool.ReadStep (data,num,ach,anent);
}
break;
case 108 :
{
@@ -9109,6 +9145,20 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
tool.ReadStep (data,num,ach,anent);
}
break;
case 703:
{
DeclareAndCast(StepAP242_DraughtingModelItemAssociation,anent,ent);
RWStepAP242_RWDraughtingModelItemAssociation tool;
tool.ReadStep (data,num,ach,anent);
}
break;
case 704:
{
DeclareAndCast(StepVisual_AnnotationPlane,anent,ent);
RWStepVisual_RWAnnotationPlane tool;
tool.ReadStep (data,num,ach,anent);
}
break;
default:
ach->AddFail("Type Mismatch when reading - Entity");
@@ -9154,12 +9204,18 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
tool.WriteStep (SW,anent);
}
break;
case 4 :
{
DeclareAndCast(StepVisual_AnnotationCurveOccurrence, anent, ent);
RWStepVisual_RWAnnotationCurveOccurrence tool;
tool.WriteStep (SW,anent);
}
break;
case 7 :
{
DeclareAndCast(StepVisual_StyledItem, anent, ent);
RWStepVisual_RWStyledItem tool;
// if (anent.IsNull()) return;
DeclareAndCast(StepVisual_AnnotationOccurrence, anent, ent);
RWStepVisual_RWAnnotationOccurrence tool;
tool.WriteStep (SW,anent);
}
@@ -9937,6 +9993,13 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
tool.WriteStep (SW,anent);
}
break;
case 107 :
{
DeclareAndCast(StepVisual_DraughtingCallout, anent, ent);
RWStepVisual_RWDraughtingCallout tool;
tool.WriteStep (SW,anent);
}
break;
case 108 :
{
@@ -13817,6 +13880,20 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
tool.WriteStep (SW,anent);
}
break;
case 703:
{
DeclareAndCast(StepAP242_DraughtingModelItemAssociation,anent,ent);
RWStepAP242_RWDraughtingModelItemAssociation tool;
tool.WriteStep (SW,anent);
}
break;
case 704:
{
DeclareAndCast(StepVisual_AnnotationPlane,anent,ent);
RWStepVisual_RWAnnotationPlane tool;
tool.WriteStep (SW,anent);
}
break;
default:
return;

View File

@@ -1,3 +1,5 @@
RWStepAP242_RWDraughtingModelItemAssociation.cxx
RWStepAP242_RWDraughtingModelItemAssociation.hxx
RWStepAP242_RWGeometricItemSpecificUsage.cxx
RWStepAP242_RWGeometricItemSpecificUsage.hxx
RWStepAP242_RWIdAttribute.cxx

View File

@@ -0,0 +1,108 @@
// Created on: 2015-10-29
// 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 <RWStepAP242_RWDraughtingModelItemAssociation.hxx>
#include <Interface_EntityIterator.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepAP242_DraughtingModelItemAssociation.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <StepRepr_Representation.hxx>
RWStepAP242_RWDraughtingModelItemAssociation::RWStepAP242_RWDraughtingModelItemAssociation () {}
void RWStepAP242_RWDraughtingModelItemAssociation::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepAP242_DraughtingModelItemAssociation)& ent) const
{
// Number of Parameter Control
if (!data->CheckNbParams(num,5,ach,"geometric_item_specific_usage")) return;
// Inherited fields of ItemIdentifiedRepresentationUsage
Handle(TCollection_HAsciiString) aName;
data->ReadString (num,1,"item_identified_representation_usage.name",ach,aName);
Handle(TCollection_HAsciiString) aDescription;
if (data->IsParamDefined (num,2)) {
data->ReadString (num,2,"item_identified_representation_usage.description",ach,aDescription);
}
StepAP242_ItemIdentifiedRepresentationUsageDefinition aDefinition;
data->ReadEntity(num,3,"item_identified_representation_usage.definition",ach,aDefinition);
Handle(StepRepr_Representation) aRepresentation;
data->ReadEntity (num,4,"item_identified_representation_usage.used_representation",ach,STANDARD_TYPE(StepRepr_Representation), aRepresentation);
Handle(StepRepr_HArray1OfRepresentationItem) anItems;
Handle(StepRepr_RepresentationItem) anEnt;
Standard_Integer nbSub;
Interface_ParamType aType = data->ParamType(num, 5);
if (aType == Interface_ParamIdent) {
data->ReadEntity(num, 5,"item_identified_representation_usage.identified_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anEnt);
anItems = new StepRepr_HArray1OfRepresentationItem (1, 1);
anItems->SetValue(1, anEnt);
}
else if (data->ReadSubList (num,5,"item_identified_representation_usage.identified_item",ach,nbSub)) {
Standard_Integer nbElements = data->NbParams(nbSub);
anItems = new StepRepr_HArray1OfRepresentationItem (1, nbElements);
for (Standard_Integer i = 1; i <= nbElements; i++) {
if (data->ReadEntity(nbSub, i,"representation_item", ach,
STANDARD_TYPE(StepRepr_RepresentationItem), anEnt))
anItems->SetValue(i, anEnt);
}
}
// Initialisation of the read entity
ent->Init(aName, aDescription, aDefinition, aRepresentation, anItems);
}
void RWStepAP242_RWDraughtingModelItemAssociation::WriteStep
(StepData_StepWriter& SW,
const Handle(StepAP242_DraughtingModelItemAssociation)& ent) const
{
// Inherited fields of ItemIdentifiedRepresentationUsage
SW.Send(ent->Name());
SW.Send(ent->Description());
SW.Send(ent->Definition().Value());
SW.Send(ent->UsedRepresentation());
if (ent->NbIdentifiedItem() == 1)
SW.Send(ent->IdentifiedItemValue(1));
else {
SW.OpenSub();
for (Standard_Integer i = 1; i <= ent->NbIdentifiedItem(); i++) {
SW.Send(ent->IdentifiedItemValue(i));
}
SW.CloseSub();
}
}
void RWStepAP242_RWDraughtingModelItemAssociation::Share(
const Handle(StepAP242_DraughtingModelItemAssociation)& ent,
Interface_EntityIterator& iter) const
{
// Inherited fields of ItemIdentifiedRepresentationUsage
iter.AddItem(ent->Definition().Value());
Standard_Integer i, nb = ent->NbIdentifiedItem();
for (i = 1; i <= nb; i++)
iter.AddItem (ent->IdentifiedItemValue(i));
}

View File

@@ -0,0 +1,46 @@
// Created on: 2015-10-29
// 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.
#ifndef _RWStepAP242_RWDraughtingModelItemAssociation_HeaderFile
#define _RWStepAP242_RWDraughtingModelItemAssociation_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
class StepData_StepReaderData;
class Interface_Check;
class StepAP242_DraughtingModelItemAssociation;
class StepData_StepWriter;
class Interface_EntityIterator;
//! Read & Write Module for DraughtingModelItemAssociation
class RWStepAP242_RWDraughtingModelItemAssociation
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT RWStepAP242_RWDraughtingModelItemAssociation();
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepAP242_DraughtingModelItemAssociation)& ent) const;
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepAP242_DraughtingModelItemAssociation)& ent) const;
Standard_EXPORT void Share (const Handle(StepAP242_DraughtingModelItemAssociation)& ent, Interface_EntityIterator& iter) const;
};
#endif // _RWStepAP242_RWDraughtingModelItemAssociation_HeaderFile

View File

@@ -1,3 +1,9 @@
RWStepVisual_RWAnnotationCurveOccurrence.cxx
RWStepVisual_RWAnnotationCurveOccurrence.hxx
RWStepVisual_RWAnnotationOccurrence.cxx
RWStepVisual_RWAnnotationOccurrence.hxx
RWStepVisual_RWAnnotationPlane.cxx
RWStepVisual_RWAnnotationPlane.hxx
RWStepVisual_RWAreaInSet.cxx
RWStepVisual_RWAreaInSet.hxx
RWStepVisual_RWBackgroundColour.cxx
@@ -32,6 +38,8 @@ RWStepVisual_RWCurveStyleFont.cxx
RWStepVisual_RWCurveStyleFont.hxx
RWStepVisual_RWCurveStyleFontPattern.cxx
RWStepVisual_RWCurveStyleFontPattern.hxx
RWStepVisual_RWDraughtingCallout.cxx
RWStepVisual_RWDraughtingCallout.hxx
RWStepVisual_RWDraughtingModel.cxx
RWStepVisual_RWDraughtingModel.hxx
RWStepVisual_RWDraughtingPreDefinedColour.cxx

View File

@@ -0,0 +1,92 @@
// Created on: 2015-10-29
// 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 <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepVisual_RWAnnotationCurveOccurrence.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepVisual_AnnotationCurveOccurrence.hxx>
RWStepVisual_RWAnnotationCurveOccurrence::RWStepVisual_RWAnnotationCurveOccurrence () {}
void RWStepVisual_RWAnnotationCurveOccurrence::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepVisual_AnnotationCurveOccurrence)& ent) const
{
// Number of Parameter Control
if (!data->CheckNbParams(num, 3, ach, "styled_item")) return;
// Inherited field : name
Handle(TCollection_HAsciiString) aName;
data->ReadString (num, 1, "name", ach, aName);
// Inherited field : styles
Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles;
Handle(StepVisual_PresentationStyleAssignment) anent2;
Standard_Integer nsub2;
if (data->ReadSubList (num,2,"styles",ach,nsub2)) {
Standard_Integer nb2 = data->NbParams(nsub2);
aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2);
for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
if (data->ReadEntity (nsub2, i2,"presentation_style_assignment", ach,
STANDARD_TYPE(StepVisual_PresentationStyleAssignment), anent2))
aStyles->SetValue(i2, anent2);
}
}
// Inherited field : item
Handle(StepRepr_RepresentationItem) aItem;
data->ReadEntity(num, 3,"item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), aItem);
// Initialisation of the read entity
ent->Init(aName, aStyles, aItem);
}
void RWStepVisual_RWAnnotationCurveOccurrence::WriteStep
(StepData_StepWriter& SW,
const Handle(StepVisual_AnnotationCurveOccurrence)& ent) const
{
//Inherited field : name
SW.Send(ent->Name());
// Inherited field : styles
SW.OpenSub();
for (Standard_Integer i2 = 1; i2 <= ent->NbStyles(); i2 ++) {
SW.Send(ent->StylesValue(i2));
}
SW.CloseSub();
// Inherited field : item
SW.Send(ent->Item());
}
void RWStepVisual_RWAnnotationCurveOccurrence::Share(const Handle(StepVisual_AnnotationCurveOccurrence)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer nbElem1 = ent->NbStyles();
for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) {
iter.GetOneItem(ent->StylesValue(is1));
}
iter.GetOneItem(ent->Item());
}

View File

@@ -0,0 +1,45 @@
// Created on: 2015-10-29
// 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.
#ifndef _RWStepVisual_RWAnnotationCurveOccurrence_HeaderFile
#define _RWStepVisual_RWAnnotationCurveOccurrence_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
class StepData_StepReaderData;
class Interface_Check;
class StepVisual_AnnotationCurveOccurrence;
class StepData_StepWriter;
class Interface_EntityIterator;
//! Read & Write Module for AnnotationCurveOccurrence
class RWStepVisual_RWAnnotationCurveOccurrence
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT RWStepVisual_RWAnnotationCurveOccurrence();
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepVisual_AnnotationCurveOccurrence)& ent) const;
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_AnnotationCurveOccurrence)& ent) const;
Standard_EXPORT void Share (const Handle(StepVisual_AnnotationCurveOccurrence)& ent, Interface_EntityIterator& iter) const;
};
#endif // _RWStepVisual_RWAnnotationCurveOccurrence_HeaderFile

View File

@@ -0,0 +1,107 @@
// Created on: 2015-10-29
// 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 <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepVisual_RWAnnotationOccurrence.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepVisual_AnnotationOccurrence.hxx>
//=======================================================================
//function : RWStepVisual_RWAnnotationOccurrence
//purpose :
//=======================================================================
RWStepVisual_RWAnnotationOccurrence::RWStepVisual_RWAnnotationOccurrence () {}
//=======================================================================
//function : ReadStep
//purpose :
//=======================================================================
void RWStepVisual_RWAnnotationOccurrence::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepVisual_AnnotationOccurrence)& ent) const
{
// Number of Parameter Control
if (!data->CheckNbParams(num, 3, ach, "annotation_occurrence")) return;
// Inherited field : name
Handle(TCollection_HAsciiString) aName;
data->ReadString (num, 1, "name", ach, aName);
// Inherited field : styles
Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles;
Handle(StepVisual_PresentationStyleAssignment) anent2;
Standard_Integer nsub2;
if (data->ReadSubList (num,2,"styles",ach,nsub2)) {
Standard_Integer nb2 = data->NbParams(nsub2);
aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2);
for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
if (data->ReadEntity (nsub2, i2,"presentation_style_assignment", ach,
STANDARD_TYPE(StepVisual_PresentationStyleAssignment), anent2))
aStyles->SetValue(i2, anent2);
}
}
// Inherited field : item
Handle(StepRepr_RepresentationItem) aItem;
data->ReadEntity(num, 3, "item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), aItem);
// Initialisation of the read entity
ent->Init(aName, aStyles, aItem);
}
//=======================================================================
//function : WriteStep
//purpose :
//=======================================================================
void RWStepVisual_RWAnnotationOccurrence::WriteStep
(StepData_StepWriter& SW,
const Handle(StepVisual_AnnotationOccurrence)& ent) const
{
// Inherited field : name
SW.Send(ent->Name());
// Inherited field : styles
SW.OpenSub();
for (Standard_Integer i2 = 1; i2 <= ent->NbStyles(); i2 ++) {
SW.Send(ent->StylesValue(i2));
}
SW.CloseSub();
// Inherited field : item
SW.Send(ent->Item());
}
//=======================================================================
//function : Share
//purpose :
//=======================================================================
void RWStepVisual_RWAnnotationOccurrence::Share(const Handle(StepVisual_AnnotationOccurrence)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer nbElem1 = ent->NbStyles();
for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) {
iter.GetOneItem(ent->StylesValue(is1));
}
iter.GetOneItem(ent->Item());
}

View File

@@ -0,0 +1,45 @@
// Created on: 2015-10-29
// 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.
#ifndef _RWStepVisual_RWAnnotationOccurrence_HeaderFile
#define _RWStepVisual_RWAnnotationOccurrence_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
class StepData_StepReaderData;
class Interface_Check;
class StepVisual_AnnotationOccurrence;
class StepData_StepWriter;
class Interface_EntityIterator;
//! Read & Write Module for AnnotationOccurrence
class RWStepVisual_RWAnnotationOccurrence
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT RWStepVisual_RWAnnotationOccurrence();
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepVisual_AnnotationOccurrence)& ent) const;
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_AnnotationOccurrence)& ent) const;
Standard_EXPORT void Share (const Handle(StepVisual_AnnotationOccurrence)& ent, Interface_EntityIterator& iter) const;
};
#endif // _RWStepVisual_RWAnnotationOccurrence_HeaderFile

View File

@@ -0,0 +1,133 @@
// Created on: 2015-10-29
// 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 <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepVisual_RWAnnotationPlane.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepVisual_AnnotationPlane.hxx>
//=======================================================================
//function : WriteStep
//purpose :
//=======================================================================
RWStepVisual_RWAnnotationPlane::RWStepVisual_RWAnnotationPlane () {}
//=======================================================================
//function : WriteStep
//purpose :
//=======================================================================
void RWStepVisual_RWAnnotationPlane::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepVisual_AnnotationPlane)& ent) const
{
// Number of Parameter Control
if (!data->CheckNbParams(num, 4, ach, "annotation_plane")) return;
// Inherited field : name
Handle(TCollection_HAsciiString) aName;
data->ReadString (num, 1, "name", ach, aName);
// Inherited field : styles
Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles;
Handle(StepVisual_PresentationStyleAssignment) anent2;
Standard_Integer nsub2;
if (data->ReadSubList (num,2,"styles",ach,nsub2)) {
Standard_Integer nb2 = data->NbParams(nsub2);
aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2);
for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
if (data->ReadEntity (nsub2, i2,"presentation_style_assignment", ach,
STANDARD_TYPE(StepVisual_PresentationStyleAssignment), anent2))
aStyles->SetValue(i2, anent2);
}
}
// Inherited field : item
Handle(StepRepr_RepresentationItem) aItem;
data->ReadEntity(num, 3, "item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), aItem);
// Own field: elements
Handle(StepVisual_HArray1OfAnnotationPlaneElement) anElements;
StepVisual_AnnotationPlaneElement anEnt;
Standard_Integer nbSub;
if (data->ReadSubList (num, 4, "elements", ach, nbSub)) {
Standard_Integer nbElements = data->NbParams(nbSub);
anElements = new StepVisual_HArray1OfAnnotationPlaneElement (1, nbElements);
for (Standard_Integer i = 1; i <= nbElements; i++) {
if (data->ReadEntity(nbSub, i,"content", ach, anEnt))
anElements->SetValue(i, anEnt);
}
}
// Initialisation of the read entity
ent->Init(aName, aStyles, aItem, anElements);
}
//=======================================================================
//function : WriteStep
//purpose :
//=======================================================================
void RWStepVisual_RWAnnotationPlane::WriteStep
(StepData_StepWriter& SW,
const Handle(StepVisual_AnnotationPlane)& ent) const
{
// Inherited field : name
SW.Send(ent->Name());
// Inherited field : styles
SW.OpenSub();
for (Standard_Integer i2 = 1; i2 <= ent->NbStyles(); i2 ++) {
SW.Send(ent->StylesValue(i2));
}
SW.CloseSub();
// Inherited field : item
SW.Send(ent->Item());
// Own field: elements
SW.OpenSub();
for (Standard_Integer i = 1; i <= ent->NbElements(); i++) {
SW.Send(ent->ElementsValue(i).Value());
}
SW.CloseSub();
}
//=======================================================================
//function : Share
//purpose :
//=======================================================================
void RWStepVisual_RWAnnotationPlane::Share(const Handle(StepVisual_AnnotationPlane)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer nbElem1 = ent->NbStyles();
for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) {
iter.GetOneItem(ent->StylesValue(is1));
}
iter.GetOneItem(ent->Item());
// Own field: contents
Standard_Integer i, nb = ent->NbElements();
for (i = 1; i <= nb; i++)
iter.AddItem (ent->ElementsValue(i).Value());
}

View File

@@ -0,0 +1,45 @@
// Created on: 2015-10-29
// 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.
#ifndef _RWStepVisual_RWAnnotationPlane_HeaderFile
#define _RWStepVisual_RWAnnotationPlane_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
class StepData_StepReaderData;
class Interface_Check;
class StepVisual_AnnotationPlane;
class StepData_StepWriter;
class Interface_EntityIterator;
//! Read & Write Module for AnnotationPlane
class RWStepVisual_RWAnnotationPlane
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT RWStepVisual_RWAnnotationPlane();
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepVisual_AnnotationPlane)& ent) const;
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_AnnotationPlane)& ent) const;
Standard_EXPORT void Share (const Handle(StepVisual_AnnotationPlane)& ent, Interface_EntityIterator& iter) const;
};
#endif // _RWStepVisual_RWAnnotationPlane_HeaderFile

View File

@@ -0,0 +1,93 @@
// Created on: 2015-10-29
// 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 <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepVisual_RWDraughtingCallout.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepVisual_DraughtingCallout.hxx>
//=======================================================================
//function : RWStepVisual_RWDraughtingCallout
//purpose :
//=======================================================================
RWStepVisual_RWDraughtingCallout::RWStepVisual_RWDraughtingCallout () {}
//=======================================================================
//function : Read
//purpose :
//=======================================================================
void RWStepVisual_RWDraughtingCallout::ReadStep(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepVisual_DraughtingCallout)& ent) const
{
if (!data->CheckNbParams(num, 2, ach, "draughting_callout")) return;
// Inherited field : name
Handle(TCollection_HAsciiString) aName;
data->ReadString (num, 1, "name" ,ach, aName);
// Own field: contents
Handle(StepVisual_HArray1OfDraughtingCalloutElement) aContents;
StepVisual_DraughtingCalloutElement anEnt;
Standard_Integer nbSub;
if (data->ReadSubList (num, 2, "contents", ach, nbSub)) {
Standard_Integer nbElements = data->NbParams(nbSub);
aContents = new StepVisual_HArray1OfDraughtingCalloutElement (1, nbElements);
for (Standard_Integer i = 1; i <= nbElements; i++) {
if (data->ReadEntity(nbSub, i,"content", ach, anEnt))
aContents->SetValue(i, anEnt);
}
}
// Initialisation of the read entity
ent->Init(aName, aContents);
}
//=======================================================================
//function : Write
//purpose :
//=======================================================================
void RWStepVisual_RWDraughtingCallout::WriteStep
(StepData_StepWriter& SW,
const Handle(StepVisual_DraughtingCallout)& ent) const
{
// Inherited field: name
SW.Send(ent->Name());
// Own field: contents
SW.OpenSub();
for (Standard_Integer i = 1; i <= ent->NbContents(); i++) {
SW.Send(ent->ContentsValue(i).Value());
}
SW.CloseSub();
}
//=======================================================================
//function : Share
//purpose :
//=======================================================================
void RWStepVisual_RWDraughtingCallout::Share (const Handle(StepVisual_DraughtingCallout) &ent,
Interface_EntityIterator& iter) const
{
// Own field: contents
Standard_Integer i, nb = ent->NbContents();
for (i = 1; i <= nb; i++)
iter.AddItem (ent->ContentsValue(i).Value());
}

View File

@@ -0,0 +1,45 @@
// Created on: 2015-10-29
// 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.
#ifndef _RWStepVisual_RWDraughtingCallout_HeaderFile
#define _RWStepVisual_RWDraughtingCallout_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
class Interface_EntityIterator;
class StepData_StepReaderData;
class Interface_Check;
class StepVisual_DraughtingCallout;
class StepData_StepWriter;
//! Read & Write Module for DraughtingCallout
class RWStepVisual_RWDraughtingCallout
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT RWStepVisual_RWDraughtingCallout();
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepVisual_DraughtingCallout)& ent) const;
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_DraughtingCallout)& ent) const;
Standard_EXPORT void Share (const Handle(StepVisual_DraughtingCallout)& ent, Interface_EntityIterator& iter) const;
};
#endif // _RWStepVisual_RWDraughtingCallout_HeaderFile

View File

@@ -93,6 +93,9 @@
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndGeoTolWthMod.hxx>
#include <StepDimTol_GeoTolAndGeoTolWthMod.hxx>
#include <StepDimTol_GeometricToleranceWithMaximumTolerance.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_Plane.hxx>
#include <StepGeom_Polyline.hxx>
#include <StepDimTol_PlacedDatumTargetFeature.hxx>
#include <StepRepr_AssemblyComponentUsage.hxx>
#include <StepRepr_CharacterizedDefinition.hxx>
@@ -141,6 +144,7 @@
#include <StepShape_DimensionalLocation.hxx>
#include <StepShape_EdgeCurve.hxx>
#include <StepShape_EdgeLoop.hxx>
#include <StepShape_GeometricCurveSet.hxx>
#include <StepShape_GeometricSet.hxx>
#include <StepShape_HArray1OfFace.hxx>
#include <StepShape_HArray1OfFaceBound.hxx>
@@ -161,8 +165,13 @@
#include <StepShape_ToleranceValue.hxx>
#include <StepShape_ValueFormatTypeQualifier.hxx>
#include <StepShape_Vertex.hxx>
#include <StepVisual_AnnotationCurveOccurrence.hxx>
#include <StepVisual_AnnotationPlane.hxx>
#include <StepVisual_DraughtingCallout.hxx>
#include <StepVisual_DraughtingCalloutElement.hxx>
#include <StepVisual_Invisibility.hxx>
#include <StepVisual_LayeredItem.hxx>
#include <StepVisual_PlanarBox.hxx>
#include <StepVisual_PresentationLayerAssignment.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_StyleContextSelect.hxx>
@@ -216,6 +225,7 @@
#include <XCAFDimTolObjects_DatumObject.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_WorkSession.hxx>
#include <StepAP242_DraughtingModelItemAssociation.hxx>
#include <StepAP242_GeometricItemSpecificUsage.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <STEPConstruct_GDTProperty.hxx>
@@ -1690,6 +1700,171 @@ static Standard_Boolean GetMassConversionFactor(Handle(StepBasic_NamedUnit)& NU,
return Standard_True;
}
//=======================================================================
//function : ReadGDTPosition
//purpose : return annotation plane and position for given GDT
// (Dimension, Geometric_Tolerance, Datum_Feature or Placed_Datum_Target_Feature)
//=======================================================================
static void ReadGDTPosition(const Interface_Graph &theGraph,
const Handle(Standard_Transient) theGDT,
Handle(Standard_Transient)& theDimObject)
{
// find the proper DraughtingModelItemAssociation
Interface_EntityIterator subs = theGraph.Sharings(theGDT);
Handle(StepAP242_DraughtingModelItemAssociation) aDMIA;
for (subs.Start(); subs.More() && aDMIA.IsNull(); subs.Next()) {
if (!subs.Value()->IsKind(STANDARD_TYPE(StepAP242_DraughtingModelItemAssociation)))
continue;
aDMIA = Handle(StepAP242_DraughtingModelItemAssociation)::DownCast(subs.Value());
Handle(TCollection_HAsciiString) aName = aDMIA->Name();
aName->LowerCase();
if (!aName->Search(new TCollection_HAsciiString("pmi representation to presentation link"))) {
aDMIA = NULL;
}
}
if (aDMIA.IsNull() || aDMIA->NbIdentifiedItem() == 0)
return;
// retrieve AnnotationPlane
Standard_Boolean isHasPlane = Standard_False;
gp_Ax2 aPlaneAxes;
Handle(StepRepr_RepresentationItem) aDMIAE = aDMIA->IdentifiedItemValue(1);
if (aDMIAE.IsNull())
return;
subs = theGraph.Sharings(aDMIAE);
Handle(StepVisual_AnnotationPlane) anAnPlane;
for (subs.Start(); subs.More() && anAnPlane.IsNull(); subs.Next()) {
anAnPlane = Handle(StepVisual_AnnotationPlane)::DownCast(subs.Value());
}
if (!anAnPlane.IsNull()) {
Handle(StepRepr_RepresentationItem) aPlaneItem = anAnPlane->Item();
Handle(StepGeom_Axis2Placement3d) aA2P3D;
//retrieve axes from AnnotationPlane
if (aPlaneItem->IsKind(STANDARD_TYPE(StepGeom_Plane))) {
Handle(StepGeom_Plane) aPlane = Handle(StepGeom_Plane)::DownCast(aPlaneItem);
aA2P3D = aPlane->Position();
}
else if (aPlaneItem->IsKind(STANDARD_TYPE(StepVisual_PlanarBox))) {
Handle(StepVisual_PlanarBox) aBox = Handle(StepVisual_PlanarBox)::DownCast(aPlaneItem);
aA2P3D = aBox->Placement().Axis2Placement3d();
}
// build gp_Ax2 from axes
if (!aA2P3D.IsNull())
{
Handle(StepGeom_Direction) anAxis = aA2P3D->Axis(),
aRefDir = aA2P3D->RefDirection();
if (!anAxis.IsNull() && !aRefDir.IsNull()) {
Handle(TColStd_HArray1OfReal) aCoords;
aCoords = anAxis->DirectionRatios();
gp_Dir aXDir(aCoords->Value(1), aCoords->Value(2), aCoords->Value(3));
aCoords = aRefDir->DirectionRatios();
gp_Dir aYDir(aCoords->Value(1), aCoords->Value(2), aCoords->Value(3));
aPlaneAxes.SetDirection(aXDir.Crossed(aYDir));
aPlaneAxes.SetYDirection(aYDir);
isHasPlane = Standard_True;
}
}
}
// set plane axes to XCAF
if (isHasPlane) {
if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DimensionObject))) {
Handle(XCAFDimTolObjects_DimensionObject) anObj =
Handle(XCAFDimTolObjects_DimensionObject)::DownCast(theDimObject);
anObj->SetPlane(aPlaneAxes);
}
else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DatumObject))) {
Handle(XCAFDimTolObjects_DatumObject) anObj =
Handle(XCAFDimTolObjects_DatumObject)::DownCast(theDimObject);
anObj->SetPlane(aPlaneAxes);
}
else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_GeomToleranceObject))) {
Handle(XCAFDimTolObjects_GeomToleranceObject) anObj =
Handle(XCAFDimTolObjects_GeomToleranceObject)::DownCast(theDimObject);
anObj->SetPlane(aPlaneAxes);
}
}
// Retrieve connecton point
// Take AnnotationCurveOccurence (other types are not processed now)
Handle(StepVisual_AnnotationCurveOccurrence) anACO;
if (aDMIAE->IsKind(STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence))) {
anACO = Handle(StepVisual_AnnotationCurveOccurrence)::DownCast(aDMIAE);
}
else if (aDMIAE->IsKind(STANDARD_TYPE(StepVisual_DraughtingCallout))) {
Handle(StepVisual_DraughtingCallout) aDCallout =
Handle(StepVisual_DraughtingCallout)::DownCast(aDMIAE);
for (Standard_Integer i = 1; i <= aDCallout->NbContents() && anACO.IsNull(); i++) {
anACO = aDCallout->ContentsValue(i).AnnotationCurveOccurrence();
}
}
if (anACO.IsNull())
return;
// Take the first polyline (it is not a rule, but temporary solution)
Handle(StepRepr_RepresentationItem) aCurveItem = anACO->Item();
Handle(StepGeom_Polyline) aCurve;
// for Dimensional_Location (and its subtypes)
Standard_Boolean isDimLoc = theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalLocation));
Handle(StepGeom_Polyline) aCurve2;
if (aCurveItem->IsKind(STANDARD_TYPE(StepShape_GeometricCurveSet))) {
Handle(StepShape_GeometricCurveSet) aCurveSet =
Handle(StepShape_GeometricCurveSet)::DownCast(aCurveItem);
Standard_Integer i = 1;
for ( ; i <= aCurveSet->NbElements() && aCurve.IsNull(); i++) {
aCurve = Handle(StepGeom_Polyline)::DownCast(aCurveSet->ElementsValue(i).Curve());
}
if (isDimLoc) {
for ( ; i <= aCurveSet->NbElements() && aCurve2.IsNull(); i++) {
aCurve2 = Handle(StepGeom_Polyline)::DownCast(aCurveSet->ElementsValue(i).Curve());
}
}
}
else {
aCurve = Handle(StepGeom_Polyline)::DownCast(aCurveItem);
}
if (aCurve.IsNull() || aCurve->NbPoints() < 1)
return;
isDimLoc = isDimLoc && !aCurve2.IsNull() && aCurve2->NbPoints() > 0;
// Take the first point of polyline (it is not a rule, but temporary solution)
Handle(StepGeom_CartesianPoint) aPnt = aCurve->PointsValue(1);
Handle(TColStd_HArray1OfReal) aCoords = aPnt->Coordinates();
gp_Pnt aPoint(aCoords->Value(1), aCoords->Value(2), aCoords->Value(3));
gp_Pnt aPoint2;
if (isDimLoc) {
Handle(StepGeom_CartesianPoint) aPnt = aCurve2->PointsValue(1);
Handle(TColStd_HArray1OfReal) aCoords = aPnt->Coordinates();
aPoint2.SetCoord(aCoords->Value(1), aCoords->Value(2), aCoords->Value(3));
}
// set point to XCAF
if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DimensionObject))) {
Handle(XCAFDimTolObjects_DimensionObject) anObj =
Handle(XCAFDimTolObjects_DimensionObject)::DownCast(theDimObject);
Handle(TColgp_HArray1OfPnt) aPnts;
if (isDimLoc)
aPnts = new TColgp_HArray1OfPnt(1, 2);
else
aPnts = new TColgp_HArray1OfPnt(1, 1);
aPnts->SetValue(1, aPoint);
if (isDimLoc)
aPnts->SetValue(2, aPoint2);
anObj->SetPoints(aPnts);
}
else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DatumObject))) {
Handle(XCAFDimTolObjects_DatumObject) anObj =
Handle(XCAFDimTolObjects_DatumObject)::DownCast(theDimObject);
anObj->SetPoint(aPoint);
}
else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_GeomToleranceObject))) {
Handle(XCAFDimTolObjects_GeomToleranceObject) anObj =
Handle(XCAFDimTolObjects_GeomToleranceObject)::DownCast(theDimObject);
anObj->SetPoint(aPoint);
}
}
//=======================================================================
//function : ReadDatums
@@ -1698,7 +1873,7 @@ static Standard_Boolean GetMassConversionFactor(Handle(StepBasic_NamedUnit)& NU,
static Standard_Boolean ReadDatums(const Handle(XCAFDoc_ShapeTool) &STool,
const Handle(XCAFDoc_DimTolTool) &DGTTool,
const Interface_Graph &graph,
Handle(Transfer_TransientProcess) &TP,
const Handle(Transfer_TransientProcess) &TP,
const TDF_Label TolerL,
const Handle(StepDimTol_GeometricToleranceWithDatumReference) GTWDR)
{
@@ -1972,8 +2147,10 @@ static Standard_Boolean setDatumToXCAF(const Handle(StepDimTol_Datum)& theDat,
aDatObj->SetModifierWithValue(aXCAFModifWithVal, aModifValue);
aDGTTool->SetDatumToGeomTol(aDatL, theGDTL);
}
if(!aDatObj.IsNull())
if(!aDatObj.IsNull()) {
ReadGDTPosition(aGraph, aSAR->RelatingShapeAspect(), aDatObj);
aDat->SetObject(aDatObj);
}
}
return !aDat.IsNull();
}
@@ -2936,6 +3113,8 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
}
aDimObj->SetType(aType);
ReadGDTPosition(aGraph, theEnt, aDimObj);
if(!aDimObj.IsNull())
{
Handle(XCAFDoc_Dimension) aDim;
@@ -3147,6 +3326,7 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
aTolObj->SetMaxValueModifier(aVal);
}
ReadGDTPosition(aGraph, theEnt, aTolObj);
aGTol->SetObject(aTolObj);
}

View File

@@ -723,6 +723,10 @@ static Standard_CString schemaAP203 = "CONFIG_CONTROL_DESIGN";
#include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
#include <StepRepr_IntegerRepresentationItem.hxx>
#include <StepRepr_ValueRepresentationItem.hxx>
#include <StepAP242_DraughtingModelItemAssociation.hxx>
#include <StepVisual_AnnotationCurveOccurrence.hxx>
#include <StepVisual_AnnotationPlane.hxx>
#include <StepVisual_DraughtingCallout.hxx>
static int init = 0;
@@ -741,7 +745,7 @@ StepAP214_Protocol::StepAP214_Protocol ()
types.Bind (STANDARD_TYPE(StepBasic_Address), 1);
types.Bind (STANDARD_TYPE(StepShape_AdvancedBrepShapeRepresentation), 2);
types.Bind (STANDARD_TYPE(StepShape_AdvancedFace), 3);
// types.Bind (STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence), 4);
types.Bind (STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence), 4);
// types.Bind (STANDARD_TYPE(StepVisual_AnnotationFillArea), 5);
// types.Bind (STANDARD_TYPE(StepVisual_AnnotationFillAreaOccurrence), 6);
types.Bind (STANDARD_TYPE(StepVisual_AnnotationOccurrence), 7);
@@ -841,7 +845,7 @@ StepAP214_Protocol::StepAP214_Protocol ()
types.Bind (STANDARD_TYPE(StepBasic_DimensionalExponents), 104);
types.Bind (STANDARD_TYPE(StepGeom_Direction), 105);
types.Bind (STANDARD_TYPE(StepVisual_DraughtingAnnotationOccurrence), 106);
// types.Bind (STANDARD_TYPE(StepVisual_DraughtingCallout), 107);
types.Bind (STANDARD_TYPE(StepVisual_DraughtingCallout), 107);
types.Bind (STANDARD_TYPE(StepVisual_DraughtingPreDefinedColour), 108);
types.Bind (STANDARD_TYPE(StepVisual_DraughtingPreDefinedCurveFont), 109);
// types.Bind (STANDARD_TYPE(StepVisual_DraughtingSubfigureRepresentation), 110);
@@ -1413,6 +1417,8 @@ StepAP214_Protocol::StepAP214_Protocol ()
types.Bind (STANDARD_TYPE(StepRepr_IntegerRepresentationItem), 700);
types.Bind (STANDARD_TYPE(StepRepr_ValueRepresentationItem), 701);
types.Bind (STANDARD_TYPE(StepRepr_FeatureForDatumTargetRelationship), 702);
types.Bind (STANDARD_TYPE(StepAP242_DraughtingModelItemAssociation), 703);
types.Bind (STANDARD_TYPE(StepVisual_AnnotationPlane), 704);
}
//=======================================================================

View File

@@ -1,3 +1,5 @@
StepAP242_DraughtingModelItemAssociation.cxx
StepAP242_DraughtingModelItemAssociation.hxx
StepAP242_GeometricItemSpecificUsage.cxx
StepAP242_GeometricItemSpecificUsage.hxx
StepAP242_IdAttribute.cxx

View File

@@ -0,0 +1,18 @@
// Created on: 2015-10-29
// 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 <StepAP242_DraughtingModelItemAssociation.hxx>
StepAP242_DraughtingModelItemAssociation::StepAP242_DraughtingModelItemAssociation () { }

View File

@@ -0,0 +1,37 @@
// Created on: 2015-10-29
// 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.
#ifndef _StepAP242_DraughtingModelItemAssociation_HeaderFile
#define _StepAP242_DraughtingModelItemAssociation_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <StepAP242_ItemIdentifiedRepresentationUsage.hxx>
class StepAP242_DraughtingModelItemAssociation;
DEFINE_STANDARD_HANDLE(StepAP242_DraughtingModelItemAssociation, StepAP242_ItemIdentifiedRepresentationUsage)
//! Added for Dimensional Tolerances
class StepAP242_DraughtingModelItemAssociation : public StepAP242_ItemIdentifiedRepresentationUsage
{
public:
Standard_EXPORT StepAP242_DraughtingModelItemAssociation();
DEFINE_STANDARD_RTTI(StepAP242_DraughtingModelItemAssociation, StepAP242_ItemIdentifiedRepresentationUsage)
};
#endif // _StepAP242_DraughtingModelItemAssociation_HeaderFile

View File

@@ -55,7 +55,7 @@ public:
}
//! Set field DefiningTolerance
inline void SetModifiers (const Handle(StepDimTol_HArray1OfToleranceZoneTarget) &theDefiningTolerance)
inline void SetDefiningTolerance (const Handle(StepDimTol_HArray1OfToleranceZoneTarget) &theDefiningTolerance)
{
myDefiningTolerance = theDefiningTolerance;
}

View File

@@ -1,5 +1,11 @@
StepVisual_AnnotationCurveOccurrence.cxx
StepVisual_AnnotationCurveOccurrence.hxx
StepVisual_AnnotationOccurrence.cxx
StepVisual_AnnotationOccurrence.hxx
StepVisual_AnnotationPlane.cxx
StepVisual_AnnotationPlane.hxx
StepVisual_AnnotationPlaneElement.cxx
StepVisual_AnnotationPlaneElement.hxx
StepVisual_AnnotationText.cxx
StepVisual_AnnotationText.hxx
StepVisual_AnnotationTextOccurrence.cxx
@@ -8,9 +14,11 @@ StepVisual_AreaInSet.cxx
StepVisual_AreaInSet.hxx
StepVisual_AreaOrView.cxx
StepVisual_AreaOrView.hxx
StepVisual_Array1OfAnnotationPlaneElement.hxx
StepVisual_Array1OfBoxCharacteristicSelect.hxx
StepVisual_Array1OfCurveStyleFontPattern.hxx
StepVisual_Array1OfDirectionCountSelect.hxx
StepVisual_Array1OfDraughtingCalloutElement.hxx
StepVisual_Array1OfFillStyleSelect.hxx
StepVisual_Array1OfInvisibleItem.hxx
StepVisual_Array1OfLayeredItem.hxx
@@ -64,6 +72,10 @@ StepVisual_DirectionCountSelect.cxx
StepVisual_DirectionCountSelect.hxx
StepVisual_DraughtingAnnotationOccurrence.cxx
StepVisual_DraughtingAnnotationOccurrence.hxx
StepVisual_DraughtingCallout.cxx
StepVisual_DraughtingCallout.hxx
StepVisual_DraughtingCalloutElement.cxx
StepVisual_DraughtingCalloutElement.hxx
StepVisual_DraughtingModel.cxx
StepVisual_DraughtingModel.hxx
StepVisual_DraughtingPreDefinedColour.cxx
@@ -82,9 +94,11 @@ StepVisual_FillStyleSelect.cxx
StepVisual_FillStyleSelect.hxx
StepVisual_FontSelect.cxx
StepVisual_FontSelect.hxx
StepVisual_HArray1OfAnnotationPlaneElement.hxx
StepVisual_HArray1OfBoxCharacteristicSelect.hxx
StepVisual_HArray1OfCurveStyleFontPattern.hxx
StepVisual_HArray1OfDirectionCountSelect.hxx
StepVisual_HArray1OfDraughtingCalloutElement.hxx
StepVisual_HArray1OfFillStyleSelect.hxx
StepVisual_HArray1OfInvisibleItem.hxx
StepVisual_HArray1OfLayeredItem.hxx

View File

@@ -0,0 +1,20 @@
// Created on: 2015-10-29
// 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 <Standard_Type.hxx>
#include <StepVisual_AnnotationCurveOccurrence.hxx>
StepVisual_AnnotationCurveOccurrence::StepVisual_AnnotationCurveOccurrence () {}

View File

@@ -0,0 +1,36 @@
// Created on: 2015-10-29
// 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.
#ifndef _StepVisual_AnnotationCurveOccurrence_HeaderFile
#define _StepVisual_AnnotationCurveOccurrence_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <StepVisual_StyledItem.hxx>
class StepVisual_AnnotationCurveOccurrence;
DEFINE_STANDARD_HANDLE(StepVisual_AnnotationCurveOccurrence, StepVisual_StyledItem)
class StepVisual_AnnotationCurveOccurrence : public StepVisual_StyledItem
{
public:
//! Returns a AnnotationCurveOccurrence
Standard_EXPORT StepVisual_AnnotationCurveOccurrence();
DEFINE_STANDARD_RTTI(StepVisual_AnnotationCurveOccurrence,StepVisual_StyledItem)
};
#endif // _StepVisual_AnnotationCurveOccurrence_HeaderFile

View File

@@ -0,0 +1,36 @@
// Created on: 2015-10-29
// 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 <Standard_Type.hxx>
#include <StepVisual_AnnotationPlane.hxx>
//=======================================================================
//function : StepVisual_AnnotationPlane
//purpose :
//=======================================================================
StepVisual_AnnotationPlane::StepVisual_AnnotationPlane () {}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void StepVisual_AnnotationPlane::Init (const Handle(TCollection_HAsciiString)& theName,
const Handle(StepVisual_HArray1OfPresentationStyleAssignment)& theStyles,
const Handle(StepRepr_RepresentationItem)& theItem,
const Handle(StepVisual_HArray1OfAnnotationPlaneElement)& theElements)
{
StepVisual_AnnotationOccurrence::Init(theName, theStyles, theItem);
myElements = theElements;
}

View File

@@ -0,0 +1,76 @@
// Created on: 2015-10-29
// 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.
#ifndef _StepVisual_AnnotationPlane_HeaderFile
#define _StepVisual_AnnotationPlane_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <StepVisual_AnnotationOccurrence.hxx>
#include <StepVisual_HArray1OfAnnotationPlaneElement.hxx>
class StepVisual_AnnotationPlane;
DEFINE_STANDARD_HANDLE(StepVisual_AnnotationPlane, StepVisual_AnnotationOccurrence)
class StepVisual_AnnotationPlane : public StepVisual_AnnotationOccurrence
{
public:
//! Returns a AnnotationPlane
Standard_EXPORT StepVisual_AnnotationPlane();
Standard_EXPORT void Init (const Handle(TCollection_HAsciiString)& theName,
const Handle(StepVisual_HArray1OfPresentationStyleAssignment)& theStyles,
const Handle(StepRepr_RepresentationItem)& theItem,
const Handle(StepVisual_HArray1OfAnnotationPlaneElement)& theElements);
//! Returns field Elements
inline Handle(StepVisual_HArray1OfAnnotationPlaneElement) Elements () const
{
return myElements;
}
//! Set field Elements
inline void SetElements (const Handle(StepVisual_HArray1OfAnnotationPlaneElement) &theElements)
{
myElements = theElements;
}
//! Returns number of Elements
inline Standard_Integer NbElements () const
{
return (myElements.IsNull() ? 0 : myElements->Length());
}
//! Returns Elements with the given number
inline StepVisual_AnnotationPlaneElement ElementsValue(const Standard_Integer theNum) const
{
return myElements->Value(theNum);
}
//! Sets Elements with given number
inline void SetElementsValue(const Standard_Integer theNum, const StepVisual_AnnotationPlaneElement& theItem)
{
myElements->SetValue (theNum, theItem);
}
DEFINE_STANDARD_RTTI(StepVisual_AnnotationPlane,StepVisual_AnnotationOccurrence)
private:
Handle(StepVisual_HArray1OfAnnotationPlaneElement) myElements;
};
#endif // _StepVisual_AnnotationPlane_HeaderFile

View File

@@ -0,0 +1,45 @@
// Created on: 2015-07-10
// 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_AnnotationPlaneElement.hxx>
#include <Interface_Macros.hxx>
#include <StepVisual_DraughtingCallout.hxx>
#include <StepVisual_StyledItem.hxx>
//=======================================================================
//function : StepVisual_AnnotationPlaneElement
//purpose :
//=======================================================================
StepVisual_AnnotationPlaneElement::StepVisual_AnnotationPlaneElement () { }
//=======================================================================
//function : CaseNum
//purpose :
//=======================================================================
Standard_Integer StepVisual_AnnotationPlaneElement::CaseNum(const Handle(Standard_Transient)& ent) const
{
if (ent.IsNull()) return 0;
if (ent->IsKind(STANDARD_TYPE(StepVisual_DraughtingCallout))) return 1;
if (ent->IsKind(STANDARD_TYPE(StepVisual_StyledItem))) return 2;
return 0;
}
Handle(StepVisual_DraughtingCallout) StepVisual_AnnotationPlaneElement::DraughtingCallout() const
{ return GetCasted(StepVisual_DraughtingCallout,Value()); }
Handle(StepVisual_StyledItem) StepVisual_AnnotationPlaneElement::StyledItem() const
{ return GetCasted(StepVisual_StyledItem,Value()); }

View File

@@ -0,0 +1,50 @@
// Created on: 2015-10-29
// 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.
#ifndef _StepVisual_AnnotationPlaneElement_HeaderFile
#define _StepVisual_AnnotationPlaneElement_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <StepData_SelectType.hxx>
#include <Standard_Integer.hxx>
class Standard_Transient;
class StepVisual_DraughtingCallout;
class StepVisual_StyledItem;
class StepVisual_AnnotationPlaneElement : public StepData_SelectType
{
public:
DEFINE_STANDARD_ALLOC
//! Returns a AnnotationPlaneElement select type
Standard_EXPORT StepVisual_AnnotationPlaneElement();
//! Recognizes a IdAttributeSelect Kind Entity that is :
//! 1 -> DraughtingCallout
//! 2 -> StyledItem
//! 0 else
Standard_EXPORT Standard_Integer CaseNum (const Handle(Standard_Transient)& ent) const;
//! returns Value as a DraughtingCallout (Null if another type)
Standard_EXPORT Handle(StepVisual_DraughtingCallout) DraughtingCallout() const;
//! returns Value as a StyledItem (Null if another type)
Standard_EXPORT Handle(StepVisual_StyledItem) StyledItem() const;
};
#endif // StepVisual_AnnotationPlaneElement

View File

@@ -0,0 +1,23 @@
// Created on: 2015-10-29
// 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.
#ifndef _StepVisual_Array1OfAnnotationPlaneElement_HeaderFile
#define _StepVisual_Array1OfAnnotationPlaneElement_HeaderFile
#include <StepVisual_AnnotationPlaneElement.hxx>
#include <NCollection_Array1.hxx>
typedef NCollection_Array1<StepVisual_AnnotationPlaneElement> StepVisual_Array1OfAnnotationPlaneElement;
#endif // _StepVisual_Array1OfAnnotationPlaneElement_HeaderFile

View File

@@ -0,0 +1,23 @@
// Created on: 2015-10-29
// 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.
#ifndef _StepVisual_Array1OfDraughtingCalloutElement_HeaderFile
#define _StepVisual_Array1OfDraughtingCalloutElement_HeaderFile
#include <StepVisual_DraughtingCalloutElement.hxx>
#include <NCollection_Array1.hxx>
typedef NCollection_Array1<StepVisual_DraughtingCalloutElement> StepVisual_Array1OfDraughtingCalloutElement;
#endif // _StepVisual_Array1OfDraughtingCalloutElement_HeaderFile

View File

@@ -0,0 +1,36 @@
// Created on: 2015-10-29
// 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 <Standard_Type.hxx>
#include <StepVisual_DraughtingCallout.hxx>
//=======================================================================
//function : StepVisual_DraughtingCallout
//purpose :
//=======================================================================
StepVisual_DraughtingCallout::StepVisual_DraughtingCallout () {}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void StepVisual_DraughtingCallout::Init (const Handle(TCollection_HAsciiString)& theName,
const Handle(StepVisual_HArray1OfDraughtingCalloutElement)& theContents)
{
StepGeom_GeometricRepresentationItem::Init(theName);
myContents = theContents;
}

View File

@@ -0,0 +1,77 @@
// Created on: 2015-10-29
// 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.
#ifndef _StepVisual_DraughtingCallout_HeaderFile
#define _StepVisual_DraughtingCallout_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <StepGeom_GeometricRepresentationItem.hxx>
#include <StepVisual_HArray1OfDraughtingCalloutElement.hxx>
class StepVisual_DraughtingCallout;
DEFINE_STANDARD_HANDLE(StepVisual_DraughtingCallout, StepGeom_GeometricRepresentationItem)
class StepVisual_DraughtingCallout : public StepGeom_GeometricRepresentationItem
{
public:
//! Returns a DraughtingCallout
Standard_EXPORT StepVisual_DraughtingCallout();
//! Init
Standard_EXPORT void StepVisual_DraughtingCallout::Init (const Handle(TCollection_HAsciiString)& theName,
const Handle(StepVisual_HArray1OfDraughtingCalloutElement)& theContents);
//! Returns field Contents
inline Handle(StepVisual_HArray1OfDraughtingCalloutElement) Contents () const
{
return myContents;
}
//! Set field Contents
inline void SetContents (const Handle(StepVisual_HArray1OfDraughtingCalloutElement) &theContents)
{
myContents = theContents;
}
//! Returns number of Contents
inline Standard_Integer NbContents () const
{
return (myContents.IsNull() ? 0 : myContents->Length());
}
//! Returns Contents with the given number
inline StepVisual_DraughtingCalloutElement ContentsValue(const Standard_Integer theNum) const
{
return myContents->Value(theNum);
}
//! Sets Contents with given number
inline void SetContentsValue(const Standard_Integer theNum, const StepVisual_DraughtingCalloutElement& theItem)
{
myContents->SetValue (theNum, theItem);
}
DEFINE_STANDARD_RTTI(StepVisual_DraughtingCallout,StepGeom_GeometricRepresentationItem)
private:
Handle(StepVisual_HArray1OfDraughtingCalloutElement) myContents;
};
#endif // _StepVisual_DraughtingCallout_HeaderFile

View File

@@ -0,0 +1,40 @@
// Created on: 2015-07-10
// 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_DraughtingCalloutElement.hxx>
#include <Interface_Macros.hxx>
#include <StepVisual_AnnotationCurveOccurrence.hxx>
//=======================================================================
//function : StepVisual_DraughtingCalloutElement
//purpose :
//=======================================================================
StepVisual_DraughtingCalloutElement::StepVisual_DraughtingCalloutElement () { }
//=======================================================================
//function : CaseNum
//purpose :
//=======================================================================
Standard_Integer StepVisual_DraughtingCalloutElement::CaseNum(const Handle(Standard_Transient)& ent) const
{
if (ent.IsNull()) return 0;
if (ent->IsKind(STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence))) return 1;
return 0;
}
Handle(StepVisual_AnnotationCurveOccurrence) StepVisual_DraughtingCalloutElement::AnnotationCurveOccurrence() const
{ return GetCasted(StepVisual_AnnotationCurveOccurrence,Value()); }

View File

@@ -0,0 +1,45 @@
// Created on: 2015-10-29
// 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.
#ifndef _StepVisual_DraughtingCalloutElement_HeaderFile
#define _StepVisual_DraughtingCalloutElement_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <StepData_SelectType.hxx>
#include <Standard_Integer.hxx>
class Standard_Transient;
class StepVisual_AnnotationCurveOccurrence;
class StepVisual_DraughtingCalloutElement : public StepData_SelectType
{
public:
DEFINE_STANDARD_ALLOC
//! Returns a DraughtingCalloutElement select type
Standard_EXPORT StepVisual_DraughtingCalloutElement();
//! Recognizes a IdAttributeSelect Kind Entity that is :
//! 1 -> AnnotationCurveOccurrence
//! 0 else
Standard_EXPORT Standard_Integer CaseNum (const Handle(Standard_Transient)& ent) const;
//! returns Value as a AnnotationCurveOccurrence (Null if another type)
Standard_EXPORT Handle(StepVisual_AnnotationCurveOccurrence) AnnotationCurveOccurrence() const;
};
#endif // StepVisual_DraughtingCalloutElement

View File

@@ -0,0 +1,24 @@
// Created on: 2015-10-29
// 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.
#ifndef _StepVisual_HArray1OfAnnotationPlaneElement_HeaderFile
#define _StepVisual_HArray1OfAnnotationPlaneElement_HeaderFile
#include <StepVisual_AnnotationPlaneElement.hxx>
#include <StepVisual_Array1OfAnnotationPlaneElement.hxx>
#include <NCollection_DefineHArray1.hxx>
DEFINE_HARRAY1(StepVisual_HArray1OfAnnotationPlaneElement, StepVisual_Array1OfAnnotationPlaneElement)
#endif // _StepVisual_HArray1OfAnnotationPlaneElement_HeaderFile

View File

@@ -0,0 +1,24 @@
// Created on: 2015-10-29
// 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.
#ifndef _StepVisual_HArray1OfDraughtingCalloutElement_HeaderFile
#define _StepVisual_HArray1OfDraughtingCalloutElement_HeaderFile
#include <StepVisual_DraughtingCalloutElement.hxx>
#include <StepVisual_Array1OfDraughtingCalloutElement.hxx>
#include <NCollection_DefineHArray1.hxx>
DEFINE_HARRAY1(StepVisual_HArray1OfDraughtingCalloutElement, StepVisual_Array1OfDraughtingCalloutElement)
#endif // _StepVisual_HArray1OfDraughtingCalloutElement_HeaderFile

View File

@@ -136,6 +136,8 @@ V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const V3d_TypeOfView th
myView->SetBackground (theViewer->GetBackgroundColor());
myView->SetGradientBackground (theViewer->GetGradientBackground());
ChangeRenderingParams() = theViewer->DefaultRenderingParams();
// camera init
Handle(Graphic3d_Camera) aCamera = new Graphic3d_Camera();
aCamera->SetFOVy (45.0);

View File

@@ -967,6 +967,9 @@ public:
Standard_EXPORT const Handle(Graphic3d_Camera)& Camera() const;
//! Returns current rendering parameters and effect settings.
//! By default it returns default parameters of current viewer.
//! To define view-specific settings use method V3d_View::ChangeRenderingParams().
//! @sa V3d_Viewer::DefaultRenderingParams()
Standard_EXPORT const Graphic3d_RenderingParams& RenderingParams() const;
//! Returns reference to current rendering parameters and effect settings.

View File

@@ -534,3 +534,21 @@ void V3d_Viewer::IncrCount()
{
myNextCount++;
}
//=======================================================================
//function : DefaultRenderingParams
//purpose :
//=======================================================================
const Graphic3d_RenderingParams& V3d_Viewer::DefaultRenderingParams() const
{
return myDefaultRenderingParams;
}
//=======================================================================
//function : SetDefaultRenderingParams
//purpose :
//=======================================================================
void V3d_Viewer::SetDefaultRenderingParams (const Graphic3d_RenderingParams& theParams)
{
myDefaultRenderingParams = theParams;
}

View File

@@ -433,12 +433,20 @@ public:
//! Returns the settings of a single Z layer.
Standard_EXPORT Graphic3d_ZLayerSettings ZLayerSettings (const Standard_Integer theLayerId);
//! Return Graphic Driver instance.
Standard_EXPORT const Handle(Graphic3d_GraphicDriver)& Driver() const;
Standard_EXPORT Standard_ExtString NextName() const;
Standard_EXPORT Standard_CString Domain() const;
//! Return default Rendering Parameters.
//! By default these parameters are set in a new V3d_View.
Standard_EXPORT const Graphic3d_RenderingParams& DefaultRenderingParams() const;
//! Set default Rendering Parameters.
Standard_EXPORT void SetDefaultRenderingParams (const Graphic3d_RenderingParams& theParams);
friend class V3d_View;
friend class V3d_Light;
@@ -484,6 +492,7 @@ private:
V3d_TypeOfSurfaceDetail MySurfaceDetail;
Quantity_PlaneAngle MyDefaultAngle;
V3d_TypeOfView MyDefaultTypeOfView;
Graphic3d_RenderingParams myDefaultRenderingParams;
Handle(V3d_Light) MyCurrentSelectedLight;
TColStd_ListIteratorOfListOfTransient myActiveViewsIterator;
TColStd_ListIteratorOfListOfTransient myDefinedViewsIterator;

View File

@@ -22,6 +22,8 @@
XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject()
{
myIsDTarget = Standard_False;
myHasPlane = Standard_False;
myHasPnt = Standard_False;
}
//=======================================================================
@@ -39,6 +41,10 @@ XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject(const Handle(XCAFDi
myIsDTarget = theObj->myIsDTarget;
myAxis = theObj->myAxis;
myDTargetType = theObj->myDTargetType;
myPlane = theObj->myPlane;
myPnt= theObj->myPnt;
myHasPlane = theObj->myHasPlane;
myHasPnt = theObj->myHasPnt;
}
//=======================================================================
@@ -254,4 +260,66 @@ Standard_Real XCAFDimTolObjects_DatumObject::GetDatumTargetWidth() const
void XCAFDimTolObjects_DatumObject::SetDatumTargetWidth(const Standard_Real theWidth)
{
myWidth = theWidth;
}
//=======================================================================
//function : GetPlane
//purpose :
//=======================================================================
gp_Ax2 XCAFDimTolObjects_DatumObject::GetPlane() const
{
return myPlane;
}
//=======================================================================
//function : SetPlane
//purpose :
//=======================================================================
void XCAFDimTolObjects_DatumObject::SetPlane(const gp_Ax2& thePlane)
{
myPlane = thePlane;
myHasPlane = Standard_True;
}
//=======================================================================
//function : GetPoint
//purpose :
//=======================================================================
gp_Pnt XCAFDimTolObjects_DatumObject::GetPoint() const
{
return myPnt;
}
//=======================================================================
//function : SetPoint
//purpose :
//=======================================================================
void XCAFDimTolObjects_DatumObject::SetPoint(const gp_Pnt& thePnt)
{
myPnt = thePnt;
myHasPnt = Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean XCAFDimTolObjects_DatumObject::HasPlane () const
{
return myHasPlane;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean XCAFDimTolObjects_DatumObject::HasPoint () const
{
return myHasPnt;
}

View File

@@ -87,7 +87,18 @@ public:
Standard_EXPORT void SetDatumTargetWidth (const Standard_Real theWidth);
Standard_EXPORT void SetPlane (const gp_Ax2& thePlane);
Standard_EXPORT gp_Ax2 GetPlane () const;
Standard_EXPORT void SetPoint (const gp_Pnt& thePnt);
Standard_EXPORT gp_Pnt GetPoint () const;
Standard_EXPORT Standard_Boolean HasPlane () const;
Standard_EXPORT Standard_Boolean HasPoint () const;
DEFINE_STANDARD_RTTI(XCAFDimTolObjects_DatumObject,Standard_Transient)
private:
@@ -103,7 +114,10 @@ private:
gp_Ax2 myAxis;
Standard_Real myLength;
Standard_Real myWidth;
gp_Ax2 myPlane;
gp_Pnt myPnt;
Standard_Boolean myHasPlane;
Standard_Boolean myHasPnt;
};

View File

@@ -24,6 +24,7 @@
XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject()
{
myHasPlane = Standard_False;
}
//=======================================================================
@@ -45,6 +46,8 @@ XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject(const Handl
myPath = theObj->myPath;
myDir = theObj->myDir;
myPnts = theObj->myPnts;
myHasPlane = theObj->myHasPlane;
myPlane = theObj->myPlane;
}
//=======================================================================
@@ -428,3 +431,44 @@ void XCAFDimTolObjects_DimensionObject::SetPoints (const Handle(TColgp_HArray1Of
{
myPnts = thePnts;
}
//=======================================================================
//function : GetPlane
//purpose :
//=======================================================================
gp_Ax2 XCAFDimTolObjects_DimensionObject::GetPlane() const
{
return myPlane;
}
//=======================================================================
//function : SetPlane
//purpose :
//=======================================================================
void XCAFDimTolObjects_DimensionObject::SetPlane(const gp_Ax2& thePlane)
{
myPlane = thePlane;
myHasPlane = Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean XCAFDimTolObjects_DimensionObject::HasPlane () const
{
return myHasPlane;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean XCAFDimTolObjects_DimensionObject::HasPoints () const
{
return myPnts->Length() > 0;
}

View File

@@ -32,6 +32,7 @@
#include <XCAFDimTolObjects_DimensionModifiersSequence.hxx>
#include <TopoDS_Edge.hxx>
#include <gp_Dir.hxx>
#include <gp_Ax2.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Real.hxx>
@@ -116,6 +117,13 @@ public:
Standard_EXPORT void SetPoints (const Handle(TColgp_HArray1OfPnt)& thePnts);
Standard_EXPORT void SetPlane (const gp_Ax2& thePlane);
Standard_EXPORT gp_Ax2 GetPlane () const;
Standard_EXPORT Standard_Boolean HasPlane () const;
Standard_EXPORT Standard_Boolean HasPoints () const;
DEFINE_STANDARD_RTTI(XCAFDimTolObjects_DimensionObject,Standard_Transient)
@@ -133,6 +141,8 @@ private:
TopoDS_Edge myPath;
gp_Dir myDir;
Handle(TColgp_HArray1OfPnt) myPnts;
gp_Ax2 myPlane;
Standard_Boolean myHasPlane;
};

View File

@@ -21,6 +21,8 @@
XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject()
{
myHasAxis = Standard_False;
myHasPlane = Standard_False;
myHasPnt = Standard_False;
}
//=======================================================================
@@ -38,8 +40,12 @@ XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject(con
myValueOfZoneModif = theObj->myValueOfZoneModif;
myModifiers = theObj->myModifiers;
myMaxValueModif = theObj->myMaxValueModif;
myAxis = theObj->GetAxis();
myHasAxis = Standard_False;
myAxis = theObj->myAxis;
myPlane = theObj->myPlane;
myPnt= theObj->myPnt;
myHasAxis = theObj->myHasAxis;
myHasPlane = theObj->myHasPlane;
myHasPnt = theObj->myHasPnt;
}
//=======================================================================
@@ -241,4 +247,66 @@ gp_Ax2 XCAFDimTolObjects_GeomToleranceObject::GetAxis() const
Standard_Boolean XCAFDimTolObjects_GeomToleranceObject::HasAxis () const
{
return myHasAxis;
}
//=======================================================================
//function : GetPlane
//purpose :
//=======================================================================
gp_Ax2 XCAFDimTolObjects_GeomToleranceObject::GetPlane() const
{
return myPlane;
}
//=======================================================================
//function : SetPlane
//purpose :
//=======================================================================
void XCAFDimTolObjects_GeomToleranceObject::SetPlane(const gp_Ax2& thePlane)
{
myPlane = thePlane;
myHasPlane = Standard_True;
}
//=======================================================================
//function : GetPoint
//purpose :
//=======================================================================
gp_Pnt XCAFDimTolObjects_GeomToleranceObject::GetPoint() const
{
return myPnt;
}
//=======================================================================
//function : SetPoint
//purpose :
//=======================================================================
void XCAFDimTolObjects_GeomToleranceObject::SetPoint(const gp_Pnt& thePnt)
{
myPnt = thePnt;
myHasPlane = Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean XCAFDimTolObjects_GeomToleranceObject::HasPlane () const
{
return myHasPlane;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean XCAFDimTolObjects_GeomToleranceObject::HasPoint () const
{
return myHasPnt;
}

View File

@@ -81,9 +81,21 @@ public:
Standard_EXPORT void SetAxis (const gp_Ax2 theAxis);
Standard_EXPORT gp_Ax2 GetAxis() const;
Standard_EXPORT void SetPlane(const gp_Ax2& thePlane);
Standard_EXPORT gp_Ax2 GetPlane() const;
Standard_EXPORT void SetPoint (const gp_Pnt& thePnt);
Standard_EXPORT gp_Pnt GetPoint () const;
Standard_EXPORT Standard_Boolean HasAxis () const;
Standard_EXPORT Standard_Boolean HasPlane () const;
Standard_EXPORT Standard_Boolean HasPoint () const;
DEFINE_STANDARD_RTTI(XCAFDimTolObjects_GeomToleranceObject,Standard_Transient)
private:
@@ -98,6 +110,11 @@ private:
Standard_Real myMaxValueModif;
gp_Ax2 myAxis;
Standard_Boolean myHasAxis;
gp_Ax2 myPlane;
gp_Pnt myPnt;
Standard_Boolean myHasPlane;
Standard_Boolean myHasPnt;
};

View File

@@ -44,6 +44,10 @@ enum ChildLab
ChildLab_DTargetLength,
ChildLab_DTargetWidth,
ChildLab_DatumTarget,
ChildLab_PlaneLoc,
ChildLab_PlaneN,
ChildLab_PlaneRef,
ChildLab_Pnt,
};
//=======================================================================
@@ -241,12 +245,12 @@ void XCAFDoc_Datum::SetObject(const Handle(XCAFDimTolObjects_DatumObject)& theOb
aLoc->SetValue(aLoc->Upper()+2,anAx.Location().Z());
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
aN->SetValue(aN->Upper()+1,anAx.Axis().Direction().Y());
aN->SetValue(aN->Upper()+2,anAx.Axis().Direction().Z());
aR->SetValue(aR->Upper(),anAx.Direction().X());
aR->SetValue(aR->Upper(),anAx.Direction().X());
aR->SetValue(aR->Upper(),anAx.Direction().X());
aR->SetValue(aR->Upper()+1,anAx.Direction().Y());
aR->SetValue(aR->Upper()+2,anAx.Direction().Z());
Label().FindChild(ChildLab_AxisLoc).AddAttribute(aLoc);
Label().FindChild(ChildLab_AxisN).AddAttribute(aN);
@@ -266,6 +270,43 @@ void XCAFDoc_Datum::SetObject(const Handle(XCAFDimTolObjects_DatumObject)& theOb
}
}
}
if (theObject->HasPlane())
{
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
Handle(TDataStd_RealArray) aN = new TDataStd_RealArray();
Handle(TDataStd_RealArray) aR = new TDataStd_RealArray();
gp_Ax2 aPln = theObject->GetPlane();
Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
for (Standard_Integer i = 1; i <= 3; i++)
aLocArr->SetValue(i, aPln.Location().Coord(i));
aLoc->ChangeArray(aLocArr);
Handle(TColStd_HArray1OfReal) aNArr = new TColStd_HArray1OfReal(1, 3);
for (Standard_Integer i = 1; i <= 3; i++)
aNArr->SetValue(i, aPln.Direction().Coord(i));
aN->ChangeArray(aNArr);
Handle(TColStd_HArray1OfReal) aRArr = new TColStd_HArray1OfReal(1, 3);
for (Standard_Integer i = 1; i <= 3; i++)
aRArr->SetValue(i, aPln.XDirection().Coord(i));
aR->ChangeArray(aRArr);
Label().FindChild(ChildLab_PlaneLoc).AddAttribute(aLoc);
Label().FindChild(ChildLab_PlaneN).AddAttribute(aN);
Label().FindChild(ChildLab_PlaneRef).AddAttribute(aR);
}
if (theObject->HasPoint())
{
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
gp_Pnt aPnt = theObject->GetPoint();
Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
for (Standard_Integer i = 1; i <= 3; i++)
aLocArr->SetValue(i, aPnt.Coord(i));
aLoc->ChangeArray(aLocArr);
Label().FindChild(ChildLab_Pnt).AddAttribute(aLoc);
}
}
//=======================================================================
@@ -304,6 +345,27 @@ Handle(XCAFDimTolObjects_DatumObject) XCAFDoc_Datum::GetObject() const
}
}
Handle(TDataStd_RealArray) aLoc;
Handle(TDataStd_RealArray) aN;
Handle(TDataStd_RealArray) aR;
if(Label().FindChild(ChildLab_PlaneLoc).FindAttribute(TDataStd_RealArray::GetID(), aLoc) && aLoc->Length() == 3 &&
Label().FindChild(ChildLab_PlaneN).FindAttribute(TDataStd_RealArray::GetID(), aN) && aN->Length() == 3 &&
Label().FindChild(ChildLab_PlaneRef).FindAttribute(TDataStd_RealArray::GetID(), aR) && aR->Length() == 3 )
{
gp_Pnt aL(aLoc->Value(aLoc->Lower()), aLoc->Value(aLoc->Lower()+1), aLoc->Value(aLoc->Lower()+2));
gp_Dir aD(aN->Value(aN->Lower()), aN->Value(aN->Lower()+1), aN->Value(aN->Lower()+2));
gp_Dir aDR(aR->Value(aR->Lower()), aR->Value(aR->Lower()+1), aR->Value(aR->Lower()+2));
gp_Ax2 anAx(aL, aD, aDR);
anObj->SetPlane(anAx);
}
Handle(TDataStd_RealArray) aPnt;
if(Label().FindChild(ChildLab_Pnt).FindAttribute(TDataStd_RealArray::GetID(), aPnt) && aPnt->Length() == 3 )
{
gp_Pnt aP(aLoc->Value(aPnt->Lower()), aPnt->Value(aPnt->Lower()+1), aPnt->Value(aPnt->Lower()+2));
anObj->SetPoint(aP);
}
Handle(TDataStd_Integer) aIsDTarget;
if(Label().FindChild(ChildLab_IsDTarget).FindAttribute(TDataStd_Integer::GetID(), aIsDTarget))
{
@@ -363,7 +425,6 @@ Handle(XCAFDimTolObjects_DatumObject) XCAFDoc_Datum::GetObject() const
}
}
}
return anObj;
}

View File

@@ -39,7 +39,10 @@ enum ChildLab
ChildLab_Modifiers,
ChildLab_Path,
ChildLab_Dir,
ChildLab_Pnts
ChildLab_Pnts,
ChildLab_PlaneLoc,
ChildLab_PlaneN,
ChildLab_PlaneRef,
};
//=======================================================================
@@ -169,18 +172,46 @@ void XCAFDoc_Dimension::SetObject (const Handle(XCAFDimTolObjects_DimensionObjec
Handle(TColgp_HArray1OfPnt) aP = theObject->GetPoints();
if(!aP.IsNull() && aP->Length() > 0)
{
anArrR = new TColStd_HArray1OfReal(1,6);
anArrR = new TColStd_HArray1OfReal(1,aP->Length() * 3);
Handle(TDataStd_RealArray) aPnts;
anArrR->SetValue(1,aP->Value(1).X());
anArrR->SetValue(2,aP->Value(1).Y());
anArrR->SetValue(3,aP->Value(1).Z());
anArrR->SetValue(4,aP->Value(2).X());
anArrR->SetValue(5,aP->Value(2).Y());
anArrR->SetValue(6,aP->Value(2).Z());
if (aP->Length() == 2) {
anArrR->SetValue(4,aP->Value(2).X());
anArrR->SetValue(5,aP->Value(2).Y());
anArrR->SetValue(6,aP->Value(2).Z());
}
aPnts = new TDataStd_RealArray();
Label().FindChild(ChildLab_Pnts).AddAttribute(aPnts);
aPnts->ChangeArray(anArrR);
}
if (theObject->HasPlane())
{
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
Handle(TDataStd_RealArray) aN = new TDataStd_RealArray();
Handle(TDataStd_RealArray) aR = new TDataStd_RealArray();
gp_Ax2 aPln = theObject->GetPlane();
Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
for (Standard_Integer i = 1; i <= 3; i++)
aLocArr->SetValue(i, aPln.Location().Coord(i));
aLoc->ChangeArray(aLocArr);
Handle(TColStd_HArray1OfReal) aNArr = new TColStd_HArray1OfReal(1, 3);
for (Standard_Integer i = 1; i <= 3; i++)
aNArr->SetValue(i, aPln.Direction().Coord(i));
aN->ChangeArray(aNArr);
Handle(TColStd_HArray1OfReal) aRArr = new TColStd_HArray1OfReal(1, 3);
for (Standard_Integer i = 1; i <= 3; i++)
aRArr->SetValue(i, aPln.XDirection().Coord(i));
aR->ChangeArray(aRArr);
Label().FindChild(ChildLab_PlaneLoc).AddAttribute(aLoc);
Label().FindChild(ChildLab_PlaneN).AddAttribute(aN);
Label().FindChild(ChildLab_PlaneRef).AddAttribute(aR);
}
}
//=======================================================================
@@ -254,12 +285,29 @@ Handle(XCAFDimTolObjects_DimensionObject) XCAFDoc_Dimension::GetObject() const
if(Label().FindChild(ChildLab_Pnts).FindAttribute(TDataStd_RealArray::GetID(), aPnts)
&& !aPnts->Array().IsNull() && aPnts->Array()->Length() > 0)
{
Handle(TColgp_HArray1OfPnt) aP = new TColgp_HArray1OfPnt(1,2);
Handle(TColgp_HArray1OfPnt) aP = new TColgp_HArray1OfPnt(1,aPnts->Array()->Length());
aP->SetValue(1, gp_Pnt(aPnts->Array()->Value(1), aPnts->Array()->Value(2), aPnts->Array()->Value(3)));
aP->SetValue(2, gp_Pnt(aPnts->Array()->Value(4), aPnts->Array()->Value(5), aPnts->Array()->Value(6)));
if (aPnts->Array()->Length() == 2)
{
aP->SetValue(2, gp_Pnt(aPnts->Array()->Value(4), aPnts->Array()->Value(5), aPnts->Array()->Value(6)));
}
anObj->SetPoints(aP);
}
Handle(TDataStd_RealArray) aLoc;
Handle(TDataStd_RealArray) aN;
Handle(TDataStd_RealArray) aR;
if(Label().FindChild(ChildLab_PlaneLoc).FindAttribute(TDataStd_RealArray::GetID(), aLoc) && aLoc->Length() == 3 &&
Label().FindChild(ChildLab_PlaneN).FindAttribute(TDataStd_RealArray::GetID(), aN) && aN->Length() == 3 &&
Label().FindChild(ChildLab_PlaneRef).FindAttribute(TDataStd_RealArray::GetID(), aR) && aR->Length() == 3 )
{
gp_Pnt aL(aLoc->Value(aLoc->Lower()), aLoc->Value(aLoc->Lower()+1), aLoc->Value(aLoc->Lower()+2));
gp_Dir aD(aN->Value(aN->Lower()), aN->Value(aN->Lower()+1), aN->Value(aN->Lower()+2));
gp_Dir aDR(aR->Value(aR->Lower()), aR->Value(aR->Lower()+1), aR->Value(aR->Lower()+2));
gp_Ax2 anAx(aL, aD, aDR);
anObj->SetPlane(anAx);
}
return anObj;
}

View File

@@ -35,7 +35,11 @@ enum ChildLab
ChildLab_aMaxValueModif,
ChildLab_AxisLoc,
ChildLab_AxisN,
ChildLab_AxisRef
ChildLab_AxisRef,
ChildLab_PlaneLoc,
ChildLab_PlaneN,
ChildLab_PlaneRef,
ChildLab_Pnt,
};
//=======================================================================
@@ -158,17 +162,54 @@ void XCAFDoc_GeomTolerance::SetObject (const Handle(XCAFDimTolObjects_GeomTolera
aLoc->SetValue(aLoc->Upper()+2,anAx.Location().Z());
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
aN->SetValue(aN->Upper()+1,anAx.Axis().Direction().Y());
aN->SetValue(aN->Upper()+2,anAx.Axis().Direction().Z());
aR->SetValue(aR->Upper(),anAx.Direction().X());
aR->SetValue(aR->Upper(),anAx.Direction().X());
aR->SetValue(aR->Upper(),anAx.Direction().X());
aR->SetValue(aR->Upper()+1,anAx.Direction().Y());
aR->SetValue(aR->Upper()+2,anAx.Direction().Z());
Label().FindChild(ChildLab_AxisLoc).AddAttribute(aLoc);
Label().FindChild(ChildLab_AxisN).AddAttribute(aN);
Label().FindChild(ChildLab_AxisRef).AddAttribute(aR);
}
if (theObject->HasPlane())
{
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
Handle(TDataStd_RealArray) aN = new TDataStd_RealArray();
Handle(TDataStd_RealArray) aR = new TDataStd_RealArray();
gp_Ax2 aPln = theObject->GetPlane();
Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
for (Standard_Integer i = 1; i <= 3; i++)
aLocArr->SetValue(i, aPln.Location().Coord(i));
aLoc->ChangeArray(aLocArr);
Handle(TColStd_HArray1OfReal) aNArr = new TColStd_HArray1OfReal(1, 3);
for (Standard_Integer i = 1; i <= 3; i++)
aNArr->SetValue(i, aPln.Direction().Coord(i));
aN->ChangeArray(aNArr);
Handle(TColStd_HArray1OfReal) aRArr = new TColStd_HArray1OfReal(1, 3);
for (Standard_Integer i = 1; i <= 3; i++)
aRArr->SetValue(i, aPln.XDirection().Coord(i));
aR->ChangeArray(aRArr);
Label().FindChild(ChildLab_PlaneLoc).AddAttribute(aLoc);
Label().FindChild(ChildLab_PlaneN).AddAttribute(aN);
Label().FindChild(ChildLab_PlaneRef).AddAttribute(aR);
}
if (theObject->HasPoint())
{
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
gp_Pnt aPnt = theObject->GetPoint();
Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
for (Standard_Integer i = 1; i <= 3; i++)
aLocArr->SetValue(i, aPnt.Coord(i));
aLoc->ChangeArray(aLocArr);
Label().FindChild(ChildLab_Pnt).AddAttribute(aLoc);
}
}
//=======================================================================
@@ -245,6 +286,24 @@ Handle(XCAFDimTolObjects_GeomToleranceObject) XCAFDoc_GeomTolerance::GetObject()
gp_Ax2 anAx(aL, aD, aDR);
anObj->SetAxis(anAx);
}
if(Label().FindChild(ChildLab_PlaneLoc).FindAttribute(TDataStd_RealArray::GetID(), aLoc) && aLoc->Length() == 3 &&
Label().FindChild(ChildLab_PlaneN).FindAttribute(TDataStd_RealArray::GetID(), aN) && aN->Length() == 3 &&
Label().FindChild(ChildLab_PlaneRef).FindAttribute(TDataStd_RealArray::GetID(), aR) && aR->Length() == 3 )
{
gp_Pnt aL(aLoc->Value(aLoc->Lower()), aLoc->Value(aLoc->Lower()+1), aLoc->Value(aLoc->Lower()+2));
gp_Dir aD(aN->Value(aN->Lower()), aN->Value(aN->Lower()+1), aN->Value(aN->Lower()+2));
gp_Dir aDR(aR->Value(aR->Lower()), aR->Value(aR->Lower()+1), aR->Value(aR->Lower()+2));
gp_Ax2 anAx(aL, aD, aDR);
anObj->SetPlane(anAx);
}
Handle(TDataStd_RealArray) aPnt;
if(Label().FindChild(ChildLab_PlaneLoc).FindAttribute(TDataStd_RealArray::GetID(), aPnt) && aPnt->Length() == 3 )
{
gp_Pnt aP(aLoc->Value(aPnt->Lower()), aPnt->Value(aPnt->Lower()+1), aPnt->Value(aPnt->Lower()+2));
anObj->SetPoint(aP);
}
return anObj;
}

21
tests/bugs/vis/bug26792 Normal file
View File

@@ -0,0 +1,21 @@
puts "================================================================"
puts "CR26792"
puts "Visualization, Graphic3d - Z-fit support for transform persistence is missing after removing Visual3d_View"
puts "================================================================"
puts ""
vinit
vclear
vaxo
box b 100 100 100
vdisplay b -trsfPers zoom
vzoom 0.01
vzfit
checkcolor 204 184 1.0 1.0 0.0
checkcolor 232 205 1.0 1.0 0.0
checkcolor 262 182 1.0 1.0 0.0
checkcolor 233 184 1.0 1.0 0.0
set only_screen 1