mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0031827: Samples - Qt OCCT Overview sample is not compiled with VS 2010
* Menu storage changed from json to XML (because Qt 4 does not support json) * C++11 for(object : container) construction changed to OCCT iterators / Qt foreach * enum type::name changed to type_name * non used class members removed * Qt connect functions changed to macros version * warning 4127 disabled for Q_INIT_RESOURCE in VS2010 / Qt 4 case * widgets parent problem on Qt 4 fixed * QRegularExpression changed to QRegExp
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
{
|
||||
"Data Exchange": {
|
||||
"Export": [{
|
||||
"text": "BREP",
|
||||
"function": "BrepExportSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "STEP",
|
||||
"function": "StepExportSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "IGES",
|
||||
"function": "IgesExportSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "STL",
|
||||
"function": "StlExportSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "VRML",
|
||||
"function": "VrmlExportSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Image",
|
||||
"function": "ImageExportSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"Import": [{
|
||||
"text": "BREP",
|
||||
"function": "BrepImportSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "STEP",
|
||||
"function": "StepImportSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "IGES",
|
||||
"function": "IgesImportSample",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
17
samples/OCCTOverview/code/DataExchange.xml
Normal file
17
samples/OCCTOverview/code/DataExchange.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<Menu>
|
||||
<MenuItem name="Data Exchange">
|
||||
<MenuItem name="Export">
|
||||
<Sample name="BREP" function="BrepExportSample"/>
|
||||
<Sample name="STEP" function="StepExportSample"/>
|
||||
<Sample name="IGES" function="IgesExportSample"/>
|
||||
<Sample name="STL" function="StlExportSample"/>
|
||||
<Sample name="VRML" function="VrmlExportSample"/>
|
||||
<Sample name="Image" function="ImageExportSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="Import">
|
||||
<Sample name="BREP" function="BrepImportSample"/>
|
||||
<Sample name="STEP" function="StepImportSample"/>
|
||||
<Sample name="IGES" function="IgesImportSample"/>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
</Menu>
|
@@ -128,8 +128,10 @@ void DataExchangeSamples::ExecuteSample (const TCollection_AsciiString& theSampl
|
||||
void DataExchangeSamples::BrepExportSample()
|
||||
{
|
||||
Standard_Boolean anIsShapeExist = Standard_False;
|
||||
for (Handle(AIS_InteractiveObject) anObject : myObject3d)
|
||||
for(NCollection_Vector<Handle(AIS_InteractiveObject)>::Iterator anIter(myObject3d);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anObject = anIter.Value();
|
||||
if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anObject))
|
||||
{
|
||||
anIsShapeExist = Standard_True;
|
||||
@@ -167,8 +169,10 @@ void DataExchangeSamples::StepExportSample()
|
||||
}
|
||||
|
||||
STEPControl_Writer aStepWriter;
|
||||
for (Handle(AIS_InteractiveObject) anObject : myObject3d)
|
||||
for(NCollection_Vector<Handle(AIS_InteractiveObject)>::Iterator anIter(myObject3d);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anObject = anIter.Value();
|
||||
if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anObject))
|
||||
{
|
||||
aStatus = aStepWriter.Transfer(aShape->Shape(), myStepType);
|
||||
@@ -207,8 +211,10 @@ void DataExchangeSamples::IgesExportSample()
|
||||
Interface_Static::IVal("XSTEP.iges.writebrep.mode"));
|
||||
|
||||
Standard_Boolean anIsShapeExist = Standard_False;
|
||||
for (Handle(AIS_InteractiveObject) anObject : myObject3d)
|
||||
for(NCollection_Vector<Handle(AIS_InteractiveObject)>::Iterator anIter(myObject3d);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anObject = anIter.Value();
|
||||
if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anObject))
|
||||
{
|
||||
anIsShapeExist = Standard_True;
|
||||
@@ -240,8 +246,10 @@ void DataExchangeSamples::StlExportSample()
|
||||
aBuilder.MakeCompound(aTopoCompound);
|
||||
|
||||
Standard_Boolean anIsShapeExist = Standard_False;
|
||||
for (Handle(AIS_InteractiveObject) anObject : myObject3d)
|
||||
for(NCollection_Vector<Handle(AIS_InteractiveObject)>::Iterator anIter(myObject3d);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anObject = anIter.Value();
|
||||
if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anObject))
|
||||
{
|
||||
anIsShapeExist = Standard_True;
|
||||
@@ -273,8 +281,10 @@ void DataExchangeSamples::VrmlExportSample()
|
||||
aBrepBuilder.MakeCompound(aTopoCompound);
|
||||
|
||||
Standard_Boolean anIsShapeExist = Standard_False;
|
||||
for (Handle(AIS_InteractiveObject) anObject : myObject3d)
|
||||
for(NCollection_Vector<Handle(AIS_InteractiveObject)>::Iterator anIter(myObject3d);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anObject = anIter.Value();
|
||||
if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anObject))
|
||||
{
|
||||
anIsShapeExist = Standard_True;
|
||||
@@ -382,8 +392,10 @@ void DataExchangeSamples::IgesImportSample()
|
||||
Standard_Boolean DataExchangeSamples::CheckFacetedBrep()
|
||||
{
|
||||
Standard_Boolean anError = Standard_False;
|
||||
for (Handle(AIS_InteractiveObject) anObject : myObject3d)
|
||||
for(NCollection_Vector<Handle(AIS_InteractiveObject)>::Iterator anIter (myObject3d);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anObject = anIter.Value();
|
||||
if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anObject))
|
||||
{
|
||||
const TopoDS_Shape aTopoShape = aShape->Shape();
|
||||
|
@@ -37,7 +37,7 @@ public:
|
||||
const Handle(V3d_View)& theView,
|
||||
const Handle(AIS_InteractiveContext)& theContext)
|
||||
: BaseSample (theSampleSourcePath, theContext),
|
||||
myStepType (STEPControl_StepModelType::STEPControl_AsIs),
|
||||
myStepType (STEPControl_AsIs),
|
||||
myView (theView)
|
||||
{
|
||||
//
|
||||
|
@@ -8,15 +8,15 @@ AdaptorVec_AIS.cxx
|
||||
AdaptorVec_AIS.h
|
||||
BaseSample.cxx
|
||||
BaseSample.h
|
||||
DataExchange.json
|
||||
DataExchange.xml
|
||||
DataExchangeSamples.cxx
|
||||
DataExchangeSamples.h
|
||||
Geometry.json
|
||||
Geometry.xml
|
||||
GeometrySamples.cxx
|
||||
GeometrySamples.h
|
||||
MakeBottle.cxx
|
||||
MakeBottle.h
|
||||
Ocaf.json
|
||||
Ocaf.xml
|
||||
OcafSamples.cxx
|
||||
OcafSamples.h
|
||||
Sample2D_Face.cxx
|
||||
@@ -34,15 +34,15 @@ TOcafFunction_CylDriver.cxx
|
||||
TOcafFunction_CylDriver.h
|
||||
TOcaf_Application.cxx
|
||||
TOcaf_Application.h
|
||||
Topology.json
|
||||
Topology.xml
|
||||
TopologySamples.cxx
|
||||
TopologySamples.h
|
||||
Triangulation.json
|
||||
Triangulation.xml
|
||||
TriangulationSamples.cxx
|
||||
TriangulationSamples.h
|
||||
Viewer2d.json
|
||||
Viewer2d.xml
|
||||
Viewer2dSamples.cxx
|
||||
Viewer2dSamples.h
|
||||
Viewer3d.json
|
||||
Viewer3d.xml
|
||||
Viewer3dSamples.cxx
|
||||
Viewer3dSamples.h
|
||||
|
@@ -1,287 +0,0 @@
|
||||
{
|
||||
"Non Parametric": {
|
||||
"Free creating": {
|
||||
"3D": [{
|
||||
"text": "Zero Dimension objects",
|
||||
"function": "ZeroDimensionObjects3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Vectors",
|
||||
"function": "Vectors3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Infinity lines",
|
||||
"function": "InfinityLines3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Second order curves",
|
||||
"function": "SecondOrderCurves3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Plane surfaces",
|
||||
"function": "PlaneSurfaces3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Second order surfaces",
|
||||
"function": "SecondOrderSurfaces3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"2D": [{
|
||||
"text": "Zero Dimension objects",
|
||||
"function": "ZeroDimensionObjects2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Vectors",
|
||||
"function": "Vectors2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Infinity lines",
|
||||
"function": "InfinityLines2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Second order curves",
|
||||
"function": "SecondOrderCurves2dSample",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
,
|
||||
"Creating based on criteria": {
|
||||
"3D": [{
|
||||
"text": "Barycenter point",
|
||||
"function": "BarycenterPoint3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Rotated vector",
|
||||
"function": "RotatedVector3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Mirrored line",
|
||||
"function": "MirroredLine3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Scaled Ellipse",
|
||||
"function": "ScaledEllipse3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Transformed cylinder",
|
||||
"function": "TransformedCylinder3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Translated torus",
|
||||
"function": "TranslatedTorus3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Conjugate objects ",
|
||||
"function": "ConjugateObjects3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Projection of point",
|
||||
"function": "ProjectionOfPoint3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Minimal distance",
|
||||
"function": "MinimalDistance3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Intersection",
|
||||
"function": "Intersection3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"2D": [{
|
||||
"text": "Translated point",
|
||||
"function": "TranslatedPoint2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Rotated direction",
|
||||
"function": "RotatedDirection2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Mirrored axis",
|
||||
"function": "MirroredAxis2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Transformed ellipse",
|
||||
"function": "TransformedEllipse2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Conjugate objects",
|
||||
"function": "ConjugateObjects2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Tangent to 2 cilcles",
|
||||
"function": "Tangent2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Projection of point",
|
||||
"function": "ProjectionOfPoint2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Minimal distance",
|
||||
"function": "MinimalDistance2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Intersection",
|
||||
"function": "Intersection2dSample",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"Data extraction": {
|
||||
"3D": [{
|
||||
"text": "Point info",
|
||||
"function": "PointInfo3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Ellipse info",
|
||||
"function": "EllipseInfo3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"2D": [{
|
||||
"text": "Point info",
|
||||
"function": "PointInfo2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Circle info",
|
||||
"function": "CircleInfo2dSample",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
},
|
||||
"Parametric": {
|
||||
"Free creating": {
|
||||
"3D": [{
|
||||
"text": "Free style curves",
|
||||
"function": "FreeStyleCurves3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Analytical surfaces",
|
||||
"function": "AnalyticalSurfaces3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Free style surfaces",
|
||||
"function": "FreeStyleSurfaces3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"2D": [{
|
||||
"text": "Free style curves",
|
||||
"function": "FreeStyleCurves2dSample",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"Creating based on geometry": {
|
||||
"3D": [{
|
||||
"text": "Trimmed curve",
|
||||
"function": "TrimmedCurve3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Offset curve",
|
||||
"function": "OffsetCurve3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "BSpline from circle",
|
||||
"function": "BSplineFromCircle3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Trimmed surface",
|
||||
"function": "TrimmedSurface3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Offset surface",
|
||||
"function": "OffsetSurface3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Extrusion surface",
|
||||
"function": "ExtrusionSurface3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Revolution surface",
|
||||
"function": "RevolutionSurface3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"2D": [{
|
||||
"text": "Trimmed curve",
|
||||
"function": "TrimmedCurve2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Offset curve",
|
||||
"function": "OffsetCurve2dSample",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"Extract geometry": [{
|
||||
"text": "Bounding box of surface (3D)",
|
||||
"function": "BoundingBoxOfSurface3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Bounding box of curves (3D)",
|
||||
"function": "BoundingBoxOfCurves3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Bounding box of curves (2D)",
|
||||
"function": "BoundingBoxOfCurves2dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"Data extraction": [{
|
||||
"text": "Dump circle info",
|
||||
"function": "DumpCircleInfoSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Dump BSpline curve info",
|
||||
"function": "DumpBSplineCurveInfoSample",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
}
|
92
samples/OCCTOverview/code/Geometry.xml
Normal file
92
samples/OCCTOverview/code/Geometry.xml
Normal file
@@ -0,0 +1,92 @@
|
||||
<Menu>
|
||||
<MenuItem name="Non Parametric">
|
||||
<MenuItem name="Free creating">
|
||||
<MenuItem name="3D">
|
||||
<Sample name="Zero Dimension objects" function="ZeroDimensionObjects3dSample"/>
|
||||
<Sample name="Vectors" function="Vectors3dSample"/>
|
||||
<Sample name="Infinity lines" function="InfinityLines3dSample"/>
|
||||
<Sample name="Second order curves" function="SecondOrderCurves3dSample"/>
|
||||
<Sample name="Plane surfaces" function="PlaneSurfaces3dSample"/>
|
||||
<Sample name="Second order surfaces" function="SecondOrderSurfaces3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="2D">
|
||||
<Sample name="Zero Dimension objects" function="ZeroDimensionObjects2dSample"/>
|
||||
<Sample name="Vectors" function="Vectors2dSample"/>
|
||||
<Sample name="Infinity lines" function="InfinityLines2dSample"/>
|
||||
<Sample name="Second order curves" function="SecondOrderCurves2dSample"/>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem name="Creating based on criteria">
|
||||
<MenuItem name="3D">
|
||||
<Sample name="Barycenter point" function="BarycenterPoint3dSample"/>
|
||||
<Sample name="Rotated vector" function="RotatedVector3dSample"/>
|
||||
<Sample name="Mirrored line" function="MirroredLine3dSample"/>
|
||||
<Sample name="Scaled Ellipse" function="ScaledEllipse3dSample"/>
|
||||
<Sample name="Transformed cylinder" function="TransformedCylinder3dSample"/>
|
||||
<Sample name="Translated torus" function="TranslatedTorus3dSample"/>
|
||||
<Sample name="Conjugate objects" function="ConjugateObjects3dSample"/>
|
||||
<Sample name="Projection of point" function="ProjectionOfPoint3dSample"/>
|
||||
<Sample name="Minimal distance" function="MinimalDistance3dSample"/>
|
||||
<Sample name="Intersection" function="Intersection3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="2D">
|
||||
<Sample name="Translated point" function="TranslatedPoint2dSample"/>
|
||||
<Sample name="Rotated direction" function="RotatedDirection2dSample"/>
|
||||
<Sample name="Mirrored axis" function="MirroredAxis2dSample"/>
|
||||
<Sample name="Transformed ellipse" function="TransformedEllipse2dSample"/>
|
||||
<Sample name="Conjugate objects" function="ConjugateObjects2dSample"/>
|
||||
<Sample name="Tangent to 2 cilcles" function="Tangent2dSample"/>
|
||||
<Sample name="Projection of point" function="ProjectionOfPoint2dSample"/>
|
||||
<Sample name="Minimal distance" function="MinimalDistance2dSample"/>
|
||||
<Sample name="Intersection" function="Intersection2dSample"/>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem name="Data extraction">
|
||||
<MenuItem name="3D">
|
||||
<Sample name="Point info" function="PointInfo3dSample"/>
|
||||
<Sample name="Ellipse info" function="EllipseInfo3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="2D">
|
||||
<Sample name="Point info" function="PointInfo2dSample"/>
|
||||
<Sample name="Circle info" function="CircleInfo2dSample"/>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem name="Parametric">
|
||||
<MenuItem name="Free creating">
|
||||
<MenuItem name="3D">
|
||||
<Sample name="Free style curves" function="FreeStyleCurves3dSample"/>
|
||||
<Sample name="Analytical surfaces" function="AnalyticalSurfaces3dSample"/>
|
||||
<Sample name="Free style surfaces" function="FreeStyleSurfaces3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="2D">
|
||||
<Sample name="Free style curves" function="FreeStyleCurves2dSample"/>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem name="Creating based on geometry">
|
||||
<MenuItem name="3D">
|
||||
<Sample name="Trimmed curve" function="TrimmedCurve3dSample"/>
|
||||
<Sample name="Offset curve" function="OffsetCurve3dSample"/>
|
||||
<Sample name="BSpline from circle" function="BSplineFromCircle3dSample"/>
|
||||
<Sample name="Trimmed surface" function="TrimmedSurface3dSample"/>
|
||||
<Sample name="Offset surface" function="OffsetSurface3dSample"/>
|
||||
<Sample name="Extrusion surface" function="ExtrusionSurface3dSample"/>
|
||||
<Sample name="Revolution surface" function="RevolutionSurface3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="2D">
|
||||
<Sample name="Trimmed curve" function="TrimmedCurve2dSample"/>
|
||||
<Sample name="Offset curve" function="OffsetCurve2dSample"/>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem name="Extract geometry">
|
||||
<Sample name="Bounding box of surface (3D)" function="BoundingBoxOfSurface3dSample"/>
|
||||
<Sample name="Bounding box of curves (3D)" function="BoundingBoxOfCurves3dSample"/>
|
||||
<Sample name="Bounding box of curves (2D)" function="BoundingBoxOfCurves2dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="Data extraction">
|
||||
<Sample name="Dump circle info" function="DumpCircleInfoSample"/>
|
||||
<Sample name="Dump BSpline curve info" function="DumpBSplineCurveInfoSample"/>
|
||||
</MenuItem>
|
||||
|
||||
</MenuItem>
|
||||
</Menu>
|
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"OCAF": {
|
||||
"1 Create": [{
|
||||
"text": "Create Box",
|
||||
"function": "CreateBoxOcafSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Create Cylinder",
|
||||
"function": "CreateCylinderOcafSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"2 Modify": [{
|
||||
"text": "Modify Box",
|
||||
"function": "ModifyBoxOcafSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Modify Cylinder",
|
||||
"function": "ModifyCylinderOcafSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"3 Action": [{
|
||||
"text": "Undo",
|
||||
"function": "UndoOcafSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Redo",
|
||||
"function": "RedoOcafSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"4 Data storage": [{
|
||||
"text": "Open OCAF",
|
||||
"function": "DialogOpenOcafSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Save binary OCAF",
|
||||
"function": "DialogSaveBinOcafSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Save XML OCAF",
|
||||
"function": "DialogSaveXmlOcafSample",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
21
samples/OCCTOverview/code/Ocaf.xml
Normal file
21
samples/OCCTOverview/code/Ocaf.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<Menu>
|
||||
<MenuItem name="OCAF">
|
||||
<MenuItem name="1 Create">
|
||||
<Sample name="Create Box" function="CreateBoxOcafSample"/>
|
||||
<Sample name="Create Cylinder" function="CreateCylinderOcafSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="2 Modify">
|
||||
<Sample name="Modify Box" function="ModifyBoxOcafSample"/>
|
||||
<Sample name="Modify Cylinder" function="ModifyCylinderOcafSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="3 Action">
|
||||
<Sample name="Undo" function="UndoOcafSample"/>
|
||||
<Sample name="Redo" function="RedoOcafSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="4 Data storage">
|
||||
<Sample name="Open OCAF" function="DialogOpenOcafSample"/>
|
||||
<Sample name="Save binary OCAF" function="DialogSaveBinOcafSample"/>
|
||||
<Sample name="Save XML OCAF" function="DialogSaveXmlOcafSample"/>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
</Menu>
|
@@ -298,8 +298,11 @@ void OcafSamples::ModifyBoxOcafSample()
|
||||
AIS_ListOfInteractive anAisObjectsList;
|
||||
myContext->DisplayedObjects(anAisObjectsList);
|
||||
Standard_Integer aBoxCount(0);
|
||||
for (Handle(AIS_InteractiveObject) anAisObject : anAisObjectsList)
|
||||
for(AIS_ListOfInteractive::Iterator anIter(anAisObjectsList);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value();
|
||||
|
||||
// Get the main label of the selected object
|
||||
Handle(TPrsStd_AISPresentation) anAisPresentation = Handle(TPrsStd_AISPresentation)::DownCast(anAisObject->GetOwner());
|
||||
TDF_Label aLabel = anAisPresentation->Label();
|
||||
@@ -398,8 +401,10 @@ void OcafSamples::ModifyCylinderOcafSample()
|
||||
AIS_ListOfInteractive anAisObjectsList;
|
||||
myContext->DisplayedObjects(anAisObjectsList);
|
||||
Standard_Integer aCylCount(0);
|
||||
for (Handle(AIS_InteractiveObject) anAisObject : anAisObjectsList)
|
||||
for(AIS_ListOfInteractive::Iterator anIter (anAisObjectsList);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value();
|
||||
// Get the main label of the selected object
|
||||
Handle(TPrsStd_AISPresentation) anAisPresentation = Handle(TPrsStd_AISPresentation)::DownCast(anAisObject->GetOwner());
|
||||
TDF_Label aLabel = anAisPresentation->Label();
|
||||
@@ -534,7 +539,7 @@ void OcafSamples::DialogOpenOcafSample()
|
||||
}
|
||||
// Open the document in the current application
|
||||
PCDM_ReaderStatus aReaderStatus = anOcaf_Application->Open(myFileName, myOcafDoc);
|
||||
if (aReaderStatus == PCDM_ReaderStatus::PCDM_RS_OK)
|
||||
if (aReaderStatus == PCDM_RS_OK)
|
||||
{
|
||||
// Connect the document CAF (myDoc) with the AISContext (myAISContext)
|
||||
TPrsStd_AISViewer::New(myOcafDoc->Main(), myViewer);
|
||||
@@ -563,7 +568,7 @@ void OcafSamples::DialogSaveBinOcafSample()
|
||||
myOcafDoc->ChangeStorageFormat("BinOcaf");
|
||||
// Saves the document in the current application
|
||||
PCDM_StoreStatus aStoreStatus = anOcaf_Application->SaveAs(myOcafDoc, myFileName);
|
||||
if (aStoreStatus == PCDM_StoreStatus::PCDM_SS_OK)
|
||||
if (aStoreStatus == PCDM_SS_OK)
|
||||
{
|
||||
myResult << "The file was saved successfully" << std::endl;
|
||||
}
|
||||
@@ -580,7 +585,7 @@ void OcafSamples::DialogSaveXmlOcafSample()
|
||||
myOcafDoc->ChangeStorageFormat("XmlOcaf");
|
||||
// Saves the document in the current application
|
||||
PCDM_StoreStatus aStoreStatus = anOcaf_Application->SaveAs(myOcafDoc, myFileName);
|
||||
if (aStoreStatus == PCDM_StoreStatus::PCDM_SS_OK)
|
||||
if (aStoreStatus == PCDM_SS_OK)
|
||||
{
|
||||
myResult << "The file was saved successfully" << std::endl;
|
||||
}
|
||||
|
@@ -44,8 +44,6 @@ public:
|
||||
//
|
||||
}
|
||||
|
||||
enum ExchangeType { None, Binary, Xml };
|
||||
|
||||
virtual void Process (const TCollection_AsciiString& theSampleName) Standard_OVERRIDE;
|
||||
|
||||
void ClearExtra();
|
||||
@@ -75,11 +73,9 @@ private:
|
||||
|
||||
private:
|
||||
|
||||
ExchangeType myExchangeType;
|
||||
TCollection_AsciiString myFileName;
|
||||
Handle(V3d_Viewer) myViewer;
|
||||
Handle(TDocStd_Document) myOcafDoc;
|
||||
|
||||
};
|
||||
|
||||
#endif //OCAFSAMPLES_H
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<RCC>
|
||||
<qresource prefix="/menus">
|
||||
<file>Geometry.json</file>
|
||||
<file>Topology.json</file>
|
||||
<file>Triangulation.json</file>
|
||||
<file>DataExchange.json</file>
|
||||
<file>Viewer3d.json</file>
|
||||
<file>Viewer2d.json</file>
|
||||
<file>Ocaf.json</file>
|
||||
<file>Geometry.xml</file>
|
||||
<file>Topology.xml</file>
|
||||
<file>Triangulation.xml</file>
|
||||
<file>DataExchange.xml</file>
|
||||
<file>Viewer3d.xml</file>
|
||||
<file>Viewer2d.xml</file>
|
||||
<file>Ocaf.xml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@@ -1,176 +0,0 @@
|
||||
{
|
||||
"Topology": {
|
||||
"Topological Shape": [{
|
||||
"text": "Vertex",
|
||||
"function": "Vertex3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Edge",
|
||||
"function": "Edge3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Face",
|
||||
"function": "Face3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Wire",
|
||||
"function": "Wire3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Shell",
|
||||
"function": "Shell3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Solid",
|
||||
"function": "Solid3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Edge (2D)",
|
||||
"function": "Edge2dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"BRep primitive objects": [{
|
||||
"text": "Box",
|
||||
"function": "Box3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Cylinder",
|
||||
"function": "Cylinder3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Revolution",
|
||||
"function": "Revolution3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"Topology access": [{
|
||||
"text": "Topology iterator",
|
||||
"function": "TopologyIterator3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Topology explorer",
|
||||
"function": "TopologyExplorer3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Assess to curve",
|
||||
"function": "AssessToCurve3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Assess to composite curve",
|
||||
"function": "AssessToCompositeCurve3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Assess to surface",
|
||||
"function": "AssessToSurface3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"Boolean operation": [{
|
||||
"text": "Common",
|
||||
"function": "Common3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Cut",
|
||||
"function": "Cut3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Fuse",
|
||||
"function": "Fuse3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Section",
|
||||
"function": "Section3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Splitter",
|
||||
"function": "Splitter3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Defeaturing",
|
||||
"function": "Defeaturing3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"Complex modelling": [{
|
||||
"text": "Fillet",
|
||||
"function": "Fillet3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Chamfer",
|
||||
"function": "Chamfer3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Offset",
|
||||
"function": "Offset3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Evolved",
|
||||
"function": "Evolved3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"Modification": [{
|
||||
"text": "Copy",
|
||||
"function": "Copy3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Transform",
|
||||
"function": "Transform3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Convert to NURBS",
|
||||
"function": "ConvertToNurbs3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Sew contiguous faces",
|
||||
"function": "SewContiguousFaces3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"Calculation": [{
|
||||
"text": "Check validity",
|
||||
"function": "CheckValidity3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Compute linear properties",
|
||||
"function": "ComputeLinearProperties3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Compute surface properties",
|
||||
"function": "ComputeSurfaceProperties3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Compute volume properties",
|
||||
"function": "ComputeVolumeProperties3dSample",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
51
samples/OCCTOverview/code/Topology.xml
Normal file
51
samples/OCCTOverview/code/Topology.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<Menu>
|
||||
<MenuItem name="Topology">
|
||||
<MenuItem name="Topological Shape">
|
||||
<Sample name="Vertex" function="Vertex3dSample"/>
|
||||
<Sample name="Edge" function="Edge3dSample"/>
|
||||
<Sample name="Face" function="Face3dSample"/>
|
||||
<Sample name="Wire" function="Wire3dSample"/>
|
||||
<Sample name="Shell" function="Shell3dSample"/>
|
||||
<Sample name="Solid" function="Solid3dSample"/>
|
||||
<Sample name="Edge (2D)" function="Edge2dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="BRep primitive objects">
|
||||
<Sample name="Box" function="Box3dSample"/>
|
||||
<Sample name="Cylinder" function="Cylinder3dSample"/>
|
||||
<Sample name="Revolution" function="Revolution3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="Topology access">
|
||||
<Sample name="Topology iterator" function="TopologyIterator3dSample"/>
|
||||
<Sample name="Topology explorer" function="TopologyExplorer3dSample"/>
|
||||
<Sample name="Assess to curve" function="AssessToCurve3dSample"/>
|
||||
<Sample name="Assess to composite curve" function="AssessToCompositeCurve3dSample"/>
|
||||
<Sample name="Assess to surface" function="AssessToSurface3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="Boolean operation">
|
||||
<Sample name="Common" function="Common3dSample"/>
|
||||
<Sample name="Cut" function="Cut3dSample"/>
|
||||
<Sample name="Fuse" function="Fuse3dSample"/>
|
||||
<Sample name="Section" function="Section3dSample"/>
|
||||
<Sample name="Splitter" function="Splitter3dSample"/>
|
||||
<Sample name="Defeaturing" function="Defeaturing3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="Complex modelling">
|
||||
<Sample name="Fillet" function="Fillet3dSample"/>
|
||||
<Sample name="Chamfer" function="Chamfer3dSample"/>
|
||||
<Sample name="Offset" function="Offset3dSample"/>
|
||||
<Sample name="Evolved" function="Evolved3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="Modification">
|
||||
<Sample name="Copy" function="Copy3dSample"/>
|
||||
<Sample name="Transform" function="Transform3dSample"/>
|
||||
<Sample name="Convert to NURBS" function="ConvertToNurbs3dSample"/>
|
||||
<Sample name="Sew contiguous faces" function="SewContiguousFaces3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="Calculation">
|
||||
<Sample name="Check validity" function="CheckValidity3dSample"/>
|
||||
<Sample name="Compute linear properties" function="ComputeLinearProperties3dSample"/>
|
||||
<Sample name="Compute surface properties" function="ComputeSurfaceProperties3dSample"/>
|
||||
<Sample name="Compute volume properties" function="ComputeVolumeProperties3dSample"/>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
</Menu>
|
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"Triangulation": {
|
||||
|
||||
"Create Triangulation": [{
|
||||
"text": "Triangulation on shape",
|
||||
"function": "Triangulation3dSample",
|
||||
"description": ""
|
||||
}]
|
||||
}
|
||||
}
|
7
samples/OCCTOverview/code/Triangulation.xml
Normal file
7
samples/OCCTOverview/code/Triangulation.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<Menu>
|
||||
<MenuItem name="Triangulation">
|
||||
<MenuItem name="Create Triangulation">
|
||||
<Sample name="Triangulation on shape" function="Triangulation3dSample"/>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
</Menu>
|
@@ -1,58 +0,0 @@
|
||||
{
|
||||
"Viewer 2D": {
|
||||
"Labels": [{
|
||||
"text": "Text",
|
||||
"function": "TextView2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Marker",
|
||||
"function": "MarkerView2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Fill Area",
|
||||
"function": "FillAreaView2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Loop on face",
|
||||
"function": "LoopOnFaceView2dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
|
||||
"Grids": [{
|
||||
"text": "Rectagular Lines",
|
||||
"function": "RectagularLineGrid2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Rectagular Points",
|
||||
"function": "RectagularPointGrid2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Circular Lines",
|
||||
"function": "CircularLineGrid2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Circular Points",
|
||||
"function": "CircularPointGrid2dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Clear",
|
||||
"function": "ClearGrid2dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
|
||||
"Image": [{
|
||||
"text": "Backgroung Image",
|
||||
"function": "BackgroungImage2dSample",
|
||||
"description": ""
|
||||
}]
|
||||
}
|
||||
}
|
20
samples/OCCTOverview/code/Viewer2d.xml
Normal file
20
samples/OCCTOverview/code/Viewer2d.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<Menu>
|
||||
<MenuItem name="Viewer 2D">
|
||||
<MenuItem name="Labels">
|
||||
<Sample name="Text" function="TextView2dSample"/>
|
||||
<Sample name="Marker" function="MarkerView2dSample"/>
|
||||
<Sample name="Fill Area" function="FillAreaView2dSample"/>
|
||||
<Sample name="Loop on face" function="LoopOnFaceView2dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="Grids">
|
||||
<Sample name="Rectagular Lines" function="RectagularLineGrid2dSample"/>
|
||||
<Sample name="Rectagular Points" function="RectagularPointGrid2dSample"/>
|
||||
<Sample name="Circular Lines" function="CircularLineGrid2dSample"/>
|
||||
<Sample name="Circular Points" function="CircularPointGrid2dSample"/>
|
||||
<Sample name="Clear" function="ClearGrid2dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="Image">
|
||||
<Sample name="Backgroung Image" function="BackgroungImage2dSample"/>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
</Menu>
|
@@ -75,7 +75,7 @@ void Viewer2dSamples::ClearExtra()
|
||||
|
||||
void Viewer2dSamples::TextView2dSample()
|
||||
{
|
||||
Standard_Integer aColor = Quantity_NameOfColor::Quantity_NOC_MATRABLUE;
|
||||
Standard_Integer aColor = Quantity_NOC_MATRABLUE;
|
||||
for (Standard_Integer j = 15; j <= 20; j++)
|
||||
{
|
||||
Handle(AIS_TextLabel) aText = new AIS_TextLabel();
|
||||
|
@@ -1,106 +0,0 @@
|
||||
{
|
||||
"Viewer 3D": {
|
||||
"Light source": [{
|
||||
"text": "Spot",
|
||||
"function": "SpotLight3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Positional",
|
||||
"function": "PositionalLight3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Directional",
|
||||
"function": "DirectionalLight3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Ambient",
|
||||
"function": "AmbientLight3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Clear",
|
||||
"function": "ClearLight3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
|
||||
"Selection mode": [{
|
||||
"text": "Vertices",
|
||||
"function": "VerticesSelect3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Edges",
|
||||
"function": "EdgesSelect3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Faces",
|
||||
"function": "FacesSelect3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Neutral point",
|
||||
"function": "NeutralPointSelect3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
|
||||
"Shape presentation": [
|
||||
{
|
||||
"text": "WireFrame",
|
||||
"function": "WireFramePresentation3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Shading",
|
||||
"function": "ShadingPresentation3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Set color to red",
|
||||
"function": "RedColorPresentation3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Set color to gray",
|
||||
"function": "GrayColorPresentation3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Set plastic material",
|
||||
"function": "PlasticPresentation3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Set bronze material",
|
||||
"function": "BronzePresentation3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Set opaque",
|
||||
"function": "OpaquePresentation3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Set half transparency",
|
||||
"function": "HalfTransparencyPresentation3dSample",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"OpenGL VBO mode": [{
|
||||
"text": "Vertex Buffer Object mode ON",
|
||||
"function": "VboOn3dSample",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"text": "Vertex Buffer Object mode OFF",
|
||||
"function": "VboOff3dSample",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
31
samples/OCCTOverview/code/Viewer3d.xml
Normal file
31
samples/OCCTOverview/code/Viewer3d.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<Menu>
|
||||
<MenuItem name="Viewer 3D">
|
||||
<MenuItem name="Light source">
|
||||
<Sample name="Spot" function="SpotLight3dSample"/>
|
||||
<Sample name="Positional" function="PositionalLight3dSample"/>
|
||||
<Sample name="Directional" function="DirectionalLight3dSample"/>
|
||||
<Sample name="Ambient" function="AmbientLight3dSample"/>
|
||||
<Sample name="Clear" function="ClearLight3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="Selection mode">
|
||||
<Sample name="Vertices" function="VerticesSelect3dSample"/>
|
||||
<Sample name="Edges" function="EdgesSelect3dSample"/>
|
||||
<Sample name="Faces" function="FacesSelect3dSample"/>
|
||||
<Sample name="Neutral point" function="NeutralPointSelect3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="Shape presentation">
|
||||
<Sample name="WireFrame" function="WireFramePresentation3dSample"/>
|
||||
<Sample name="Shading" function="ShadingPresentation3dSample"/>
|
||||
<Sample name="Set color to red" function="RedColorPresentation3dSample"/>
|
||||
<Sample name="Set color to gray" function="GrayColorPresentation3dSample"/>
|
||||
<Sample name="Set plastic material" function="PlasticPresentation3dSample"/>
|
||||
<Sample name="Set bronze material" function="BronzePresentation3dSample"/>
|
||||
<Sample name="Set opaque" function="OpaquePresentation3dSample"/>
|
||||
<Sample name="Set half transparency" function="HalfTransparencyPresentation3dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="OpenGL VBO mode">
|
||||
<Sample name="Vertex Buffer Object mode ON" function="VboOn3dSample"/>
|
||||
<Sample name="Vertex Buffer Object mode OFF" function="VboOff3dSample"/>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
</Menu>
|
@@ -99,12 +99,14 @@ void Viewer3dSamples::ClearExtra()
|
||||
ClearLight3dSample();
|
||||
// Delete Lights
|
||||
V3d_ListOfLight aLights;
|
||||
for (V3d_ListOfLightIterator anIter = myView->Viewer()->DefinedLightIterator(); anIter.More(); anIter.Next())
|
||||
for(V3d_ListOfLightIterator anIter = myView->Viewer()->DefinedLightIterator();
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
aLights.Append(anIter.Value());
|
||||
}
|
||||
|
||||
for (V3d_ListOfLightIterator aLightIter (aLights); aLightIter.More(); aLightIter.Next())
|
||||
for(V3d_ListOfLightIterator aLightIter (aLights);
|
||||
aLightIter.More(); aLightIter.Next())
|
||||
{
|
||||
myView->Viewer()->DelLight (aLightIter.Value());
|
||||
}
|
||||
@@ -117,27 +119,31 @@ void Viewer3dSamples::ClearExtra()
|
||||
void Viewer3dSamples::SpotLight3dSample()
|
||||
{
|
||||
// Spot light source creation
|
||||
Handle(V3d_SpotLight) aSpotLight = new V3d_SpotLight(gp_Pnt(100.0, 0.0, 0.0), gp_Dir(-1.0, 0.0, 0.0), Quantity_NOC_RED);
|
||||
Handle(V3d_SpotLight) aSpotLight =
|
||||
new V3d_SpotLight(gp_Pnt(100.0, 0.0, 0.0), gp_Dir(-1.0, 0.0, 0.0), Quantity_NOC_RED);
|
||||
aSpotLight->SetIntensity(5000);
|
||||
myView->SetLightOn(aSpotLight);
|
||||
}
|
||||
|
||||
void Viewer3dSamples::PositionalLight3dSample()
|
||||
{
|
||||
Handle(V3d_PositionalLight) aPositionalLight = new V3d_PositionalLight(gp_Pnt(0.0, -100.0, 5.0), Quantity_NOC_GREEN);
|
||||
Handle(V3d_PositionalLight) aPositionalLight =
|
||||
new V3d_PositionalLight(gp_Pnt(0.0, -100.0, 5.0), Quantity_NOC_GREEN);
|
||||
aPositionalLight->SetAttenuation(1, 0);
|
||||
myView->SetLightOn(aPositionalLight);
|
||||
}
|
||||
|
||||
void Viewer3dSamples::DirectionalLight3dSample()
|
||||
{
|
||||
Handle(V3d_DirectionalLight) aDirectionalLight = new V3d_DirectionalLight(gp_Dir(-1.0, 0.0, -1.0), Quantity_NOC_BLUE1);
|
||||
Handle(V3d_DirectionalLight) aDirectionalLight =
|
||||
new V3d_DirectionalLight(gp_Dir(-1.0, 0.0, -1.0), Quantity_NOC_BLUE1);
|
||||
myView->SetLightOn(aDirectionalLight);
|
||||
}
|
||||
|
||||
void Viewer3dSamples::AmbientLight3dSample()
|
||||
{
|
||||
Handle(V3d_AmbientLight) aAmbientLight = new V3d_AmbientLight(Quantity_NOC_MAGENTA1);
|
||||
Handle(V3d_AmbientLight) aAmbientLight =
|
||||
new V3d_AmbientLight(Quantity_NOC_MAGENTA1);
|
||||
myView->SetLightOn(aAmbientLight);
|
||||
}
|
||||
|
||||
@@ -145,23 +151,27 @@ void Viewer3dSamples::ClearLight3dSample()
|
||||
{
|
||||
// Setting Off all viewer active lights
|
||||
V3d_ListOfLight aLights;
|
||||
for (V3d_ListOfLightIterator anIter = myView->Viewer()->ActiveLightIterator(); anIter.More(); anIter.Next())
|
||||
for(V3d_ListOfLightIterator anIter = myView->Viewer()->ActiveLightIterator();
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
aLights.Append(anIter.Value());
|
||||
}
|
||||
|
||||
for (V3d_ListOfLightIterator aLightIter (aLights); aLightIter.More(); aLightIter.Next())
|
||||
for(V3d_ListOfLightIterator aLightIter(aLights);
|
||||
aLightIter.More(); aLightIter.Next())
|
||||
{
|
||||
myView->Viewer()->SetLightOff (aLightIter.Value());
|
||||
}
|
||||
// Setting Off all view active lights
|
||||
aLights.Clear();
|
||||
for (V3d_ListOfLightIterator anIter = myView->ActiveLightIterator(); anIter.More(); anIter.Next())
|
||||
for(V3d_ListOfLightIterator anIter = myView->ActiveLightIterator();
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
aLights.Append(anIter.Value());
|
||||
}
|
||||
|
||||
for (V3d_ListOfLightIterator aLightIter (aLights); aLightIter.More(); aLightIter.Next())
|
||||
for(V3d_ListOfLightIterator aLightIter (aLights);
|
||||
aLightIter.More(); aLightIter.Next())
|
||||
{
|
||||
myView->SetLightOff (aLightIter.Value());
|
||||
}
|
||||
@@ -197,8 +207,10 @@ void Viewer3dSamples::WireFramePresentation3dSample()
|
||||
{
|
||||
AIS_ListOfInteractive anAisObjectsList;
|
||||
myContext->DisplayedObjects(anAisObjectsList);
|
||||
for (Handle(AIS_InteractiveObject) anAisObject : anAisObjectsList)
|
||||
for(AIS_ListOfInteractive::Iterator anIter(anAisObjectsList);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value();
|
||||
myContext->SetDisplayMode(anAisObject, 0, false); // set wireframe
|
||||
}
|
||||
myContext->UpdateCurrentViewer();
|
||||
@@ -208,8 +220,10 @@ void Viewer3dSamples::ShadingPresentation3dSample()
|
||||
{
|
||||
AIS_ListOfInteractive anAisObjectsList;
|
||||
myContext->DisplayedObjects(anAisObjectsList);
|
||||
for (Handle(AIS_InteractiveObject) anAisObject : anAisObjectsList)
|
||||
for(AIS_ListOfInteractive::Iterator anIter(anAisObjectsList);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value();
|
||||
myContext->SetDisplayMode(anAisObject, 1, false); // set shading
|
||||
}
|
||||
myContext->UpdateCurrentViewer();
|
||||
@@ -219,8 +233,10 @@ void Viewer3dSamples::RedColorPresentation3dSample()
|
||||
{
|
||||
AIS_ListOfInteractive anAisObjectsList;
|
||||
myContext->DisplayedObjects(anAisObjectsList);
|
||||
for (Handle(AIS_InteractiveObject) anAisObject : anAisObjectsList)
|
||||
for(AIS_ListOfInteractive::Iterator anIter(anAisObjectsList);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value();
|
||||
Quantity_Color aShapeColor;
|
||||
myContext->Color(anAisObject, aShapeColor);
|
||||
myResult << "A Current shape color: Red = " << aShapeColor.Red()
|
||||
@@ -236,16 +252,20 @@ void Viewer3dSamples::GrayColorPresentation3dSample()
|
||||
{
|
||||
AIS_ListOfInteractive anAisObjectsList;
|
||||
myContext->DisplayedObjects(anAisObjectsList);
|
||||
for (Handle(AIS_InteractiveObject) anAisObject : anAisObjectsList)
|
||||
for(AIS_ListOfInteractive::Iterator anIter(anAisObjectsList);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value();
|
||||
Quantity_Color aShapeColor;
|
||||
myContext->Color(anAisObject, aShapeColor);
|
||||
myResult << "A Current shape color: Hue = " << aShapeColor.Hue()
|
||||
<< " Light = " << aShapeColor.Light() << " Saturation = " << aShapeColor.Saturation() << std::endl;
|
||||
<< " Light = " << aShapeColor.Light()
|
||||
<< " Saturation = " << aShapeColor.Saturation() << std::endl;
|
||||
aShapeColor.SetValues(0.0, 0.3, 0.1, Quantity_TOC_HLS);
|
||||
myContext->SetColor(anAisObject, aShapeColor, Standard_False);
|
||||
myResult << "A New shape color: Hue = " << aShapeColor.Hue()
|
||||
<< " Light = " << aShapeColor.Light() << " Saturation = " << aShapeColor.Saturation() << std::endl;
|
||||
<< " Light = " << aShapeColor.Light()
|
||||
<< " Saturation = " << aShapeColor.Saturation() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,8 +274,10 @@ void Viewer3dSamples::PlasticPresentation3dSample()
|
||||
AIS_ListOfInteractive anAisObjectsList;
|
||||
myContext->DisplayedObjects(anAisObjectsList);
|
||||
Graphic3d_NameOfMaterial aMaterial = Graphic3d_NOM_PLASTIC;
|
||||
for (Handle(AIS_InteractiveObject) anAisObject : anAisObjectsList)
|
||||
for(AIS_ListOfInteractive::Iterator anIter (anAisObjectsList);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value();
|
||||
myContext->SetMaterial(anAisObject, aMaterial, Standard_False);
|
||||
}
|
||||
myContext->UpdateCurrentViewer();
|
||||
@@ -266,8 +288,10 @@ void Viewer3dSamples::BronzePresentation3dSample()
|
||||
AIS_ListOfInteractive anAisObjectsList;
|
||||
myContext->DisplayedObjects(anAisObjectsList);
|
||||
Graphic3d_NameOfMaterial aMaterial = Graphic3d_NOM_BRONZE;
|
||||
for (Handle(AIS_InteractiveObject) anAisObject : anAisObjectsList)
|
||||
for(AIS_ListOfInteractive::Iterator anIter (anAisObjectsList);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value();
|
||||
myContext->SetMaterial(anAisObject, aMaterial, Standard_False);
|
||||
}
|
||||
myContext->UpdateCurrentViewer();
|
||||
@@ -277,8 +301,10 @@ void Viewer3dSamples::OpaquePresentation3dSample()
|
||||
{
|
||||
AIS_ListOfInteractive anAisObjectsList;
|
||||
myContext->DisplayedObjects(anAisObjectsList);
|
||||
for (Handle(AIS_InteractiveObject) anAisObject : anAisObjectsList)
|
||||
for(AIS_ListOfInteractive::Iterator anIter (anAisObjectsList);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value();
|
||||
myContext->SetTransparency(anAisObject, 0.0, Standard_False);
|
||||
}
|
||||
myContext->UpdateCurrentViewer();
|
||||
@@ -288,8 +314,10 @@ void Viewer3dSamples::HalfTransparencyPresentation3dSample()
|
||||
{
|
||||
AIS_ListOfInteractive anAisObjectsList;
|
||||
myContext->DisplayedObjects(anAisObjectsList);
|
||||
for (Handle(AIS_InteractiveObject) anAisObject : anAisObjectsList)
|
||||
for(AIS_ListOfInteractive::Iterator anIter (anAisObjectsList);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value();
|
||||
myContext->SetTransparency(anAisObject, 0.5, Standard_False);
|
||||
}
|
||||
myContext->UpdateCurrentViewer();
|
||||
@@ -297,7 +325,8 @@ void Viewer3dSamples::HalfTransparencyPresentation3dSample()
|
||||
|
||||
void Viewer3dSamples::VboOn3dSample()
|
||||
{
|
||||
if (Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(myContext->CurrentViewer()->Driver()))
|
||||
if(Handle(OpenGl_GraphicDriver) aDriver =
|
||||
Handle(OpenGl_GraphicDriver)::DownCast(myContext->CurrentViewer()->Driver()))
|
||||
{
|
||||
aDriver->ChangeOptions().vboDisable = Standard_False;
|
||||
}
|
||||
@@ -305,7 +334,8 @@ void Viewer3dSamples::VboOn3dSample()
|
||||
|
||||
void Viewer3dSamples::VboOff3dSample()
|
||||
{
|
||||
if (Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(myContext->CurrentViewer()->Driver()))
|
||||
if(Handle(OpenGl_GraphicDriver) aDriver =
|
||||
Handle(OpenGl_GraphicDriver)::DownCast(myContext->CurrentViewer()->Driver()))
|
||||
{
|
||||
aDriver->ChangeOptions().vboDisable = Standard_True;
|
||||
}
|
||||
|
Reference in New Issue
Block a user