1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0031442: Samples - remove unsupported sample mfc/occtdemo

This commit is contained in:
kgv 2020-03-19 09:47:09 +03:00 committed by bugmaster
parent dc9f1dbf69
commit 877fd611ac
166 changed files with 0 additions and 103201 deletions

View File

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="All"
SccProjectName=""
SccLocalPath=""
Keyword="MakeFileProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="10"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/All.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="10"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/All.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,431 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Approx"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/Approx.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBO.lib TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib"
OutputFile=".\../Debug/Approx.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/Approx.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/Approx.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/Approx.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBO.lib TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib"
OutputFile=".\../Release/Approx.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/Approx.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/Approx.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="Approx_Presentation.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="Approx_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
<File
RelativePath="..\Common\WNT\res\occ_logo.bmp">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,603 +0,0 @@
// Approx_Presentation.cpp: implementation of the Approx_Presentation class.
// Approximation of curves and surfaces from points.
////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Approx_Presentation.h"
#include <GeomAPI_PointsToBSpline.hxx>
#include <GeomAPI_PointsToBSplineSurface.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <gp_Pnt.hxx>
#ifdef WNT
#define EOL "\r\n"
#else
#define EOL "\n"
#endif
#define SCALE 100
// Initialization of global variable with an instance of this class
OCCDemo_Presentation* OCCDemo_Presentation::Current = new Approx_Presentation;
// Initialization of array of samples
const Approx_Presentation::PSampleFuncType Approx_Presentation::SampleFuncs[] =
{
&Approx_Presentation::sample1,
&Approx_Presentation::sample2,
&Approx_Presentation::sample3,
&Approx_Presentation::sample4
};
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Approx_Presentation::Approx_Presentation()
{
myIndex = 0;
myNbSamples = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
setName ("Approximation of curves and surfaces.");
}
//////////////////////////////////////////////////////////////////////
// Sample execution
//////////////////////////////////////////////////////////////////////
void Approx_Presentation::DoSample()
{
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbSamples)
(this->*SampleFuncs[myIndex])();
}
//////////////////////////////////////////////////////////////////////
// Sample functions
//////////////////////////////////////////////////////////////////////
//================================================================
//defining the data of BSpline curves and surfaces:
static Standard_Real Tol [] =
{
0.5*SCALE,
0.7*SCALE,
0.4*SCALE,
1*SCALE
};
static Standard_Integer DegMin [] =
{
2,3,5,7
};
static Standard_Integer DegMax [] =
{
7,9,10,12
};
static GeomAbs_Shape Continuity [] =
{
GeomAbs_C2, GeomAbs_C1, GeomAbs_C2, GeomAbs_C3
};
//================================================================
// Function : Comment
// Purpose :
//================================================================
static TCollection_AsciiString Comment(Standard_Real Step,
Standard_Integer Upper,
Standard_Integer DegMin,
Standard_Integer DegMax,
Standard_Integer Indicator,
Standard_Real Tol)
{
TCollection_AsciiString aText;
aText = (
"/////////////////////////////////////////////////////////////////" EOL
"// Approximation of surface." EOL
"// Building a BSpline surface which approximates a set of points." EOL
"/////////////////////////////////////////////////////////////////" EOL EOL
"// creating a set of points:" EOL
);
aText += "Standard_Real Step = ";
aText += TCollection_AsciiString(Step);
aText += ";" EOL;
aText += "Standard_Integer Upper = ";
aText += TCollection_AsciiString(Upper);
aText += ";" EOL EOL;
aText += (
" //a set of X and Y coordinates:" EOL
" Standard_Real aXStep = Step , aYStep = Step ;" EOL
" Standard_Real aX0 = -300, aY0 = -200;" EOL
" //Z coordinates:" EOL
" TColStd_Array2OfReal aZPoints( 1, Upper , 1, Upper );" EOL EOL
"// initializing array of Z coordinates:" EOL
"// aZPoints(1,1) = -2;" EOL
"// aZPoints(1,2) = 3;" EOL
"// ..." EOL EOL
"//creating a approximate BSpline surface:" EOL
);
aText += "Parameters of surface:" EOL ;
aText += "DegMin = ";
aText += TCollection_AsciiString(DegMin);
aText += ";" EOL;
aText += "DegMax = ";
aText += TCollection_AsciiString(DegMax);
aText += ";" EOL;
aText += "Continuity = " ;
if( Indicator == 2 )
aText += "GeomAbs_C1";
if( Indicator == 3 )
aText += "GeomAbs_C2";
if( Indicator == 4 )
aText += "GeomAbs_C3";
aText += ";" EOL;
aText += "Tolerance = ";
aText += TCollection_AsciiString(Tol/SCALE);
aText += ";" EOL EOL ;
aText += (
"GeomAPI_PointsToBSplineSurface aPTBS;" EOL
"aPTBS.Init(aZPoints,aX0,aXStep,aY0,aYStep," EOL
" DegMin,DegMax,Continuity,Tolerance);" EOL
"Handle(Geom_BSplineSurface) aSurface = aPTBS.Surface();" EOL EOL EOL
);
return aText;
}
//================================================================
// Function : Approx_Presentation::CreateBSplineSurface
// Purpose :
//================================================================
Handle(Geom_BSplineSurface) Approx_Presentation::CreateBSplineSurface(TColStd_Array2OfReal& aZPoints,
Standard_Real theXStep,
Standard_Real theYStep,
Standard_Integer Count)
{
Standard_Real aX0 = -300, aY0 = -200;
GeomAPI_PointsToBSplineSurface aPTBS;
aPTBS.Init(aZPoints,aX0,theXStep,aY0,theYStep,
DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
Handle(Geom_BSplineSurface) aSurface = aPTBS.Surface();
return aSurface;
}
//================================================================
// Function : Approx_Presentation::DrawModifyBSplineSurface
// Purpose :
//================================================================
Standard_Boolean Approx_Presentation::DrawModifyBSplineSurface(TColStd_Array2OfReal& aZPoints,
Standard_Real theXStep,
Standard_Real theYStep,
Standard_Integer theIndexX,
Standard_Integer theIndexY,
Standard_Real theDeflection,
Handle(AIS_InteractiveObject)& aMovePnt,
Handle(AIS_InteractiveObject)& aObj,
Standard_Integer Count)
{
Handle(AIS_InteractiveObject) auxObj;
Standard_Real aX0 = -300, aY0 = -200;
Standard_Real aLastZ = aZPoints(theIndexX,theIndexY);
aZPoints(theIndexX,theIndexY) += 100*theDeflection;
Standard_Real aCurrentX = aX0 + theXStep*(theIndexX-1),
aCurrentY = aY0 + theYStep*(theIndexY-1);
getAISContext()->Erase(aMovePnt);
aMovePnt = drawPoint(gp_Pnt(aCurrentX,aCurrentY,aZPoints(theIndexX,theIndexY)));
if(WAIT_A_LITTLE) return Standard_False;
GeomAPI_PointsToBSplineSurface aPTBS;
aPTBS.Init(aZPoints,aX0,theXStep,aY0,theYStep,
DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
aZPoints(theIndexX,theIndexY) = aLastZ;
Handle(Geom_BSplineSurface) aSurface = aPTBS.Surface();
auxObj = drawSurface(aSurface);
getAISContext()->Erase(aObj);
aObj = auxObj;
if(WAIT_A_SECOND) return Standard_False;
return Standard_True;
}
//================================================================
// Function : Approx_Presentation::sample1
// Purpose :
//================================================================
void Approx_Presentation::sample1()
{
Standard_Integer Count = 0;
TCollection_AsciiString aText = (
"//////////////////////////////////////////////////////////////" EOL
"// Approximation of curve." EOL
"// Building a BSpline curve which approximates a set of points." EOL
"//////////////////////////////////////////////////////////////" EOL EOL
"// creating a set of points to approximate," EOL
"// nPoint is the number of points:" EOL
"Standard_Integer nPoint = 20;" EOL
"TColgp_Array1OfPnt aCurvePoint (1, nPoint);" EOL EOL
"// initializing this array of points:" EOL
"// aCurvePoint(1,1) = gp_Pnt(-6,1,0);" EOL
"// aCurvePoint(1,2) = gp_Pnt(-5,1.5,0);" EOL
"// ..." EOL EOL
"//creating an empty approximation algorithm:" EOL
"GeomAPI_PointsToBSpline aPTB;" EOL EOL
"//creating a approximate BSpline curve:" EOL
);
aText += "//parameters of curve:" EOL ;
aText += "DegMin = ";
aText += TCollection_AsciiString(DegMin[Count]);
aText += ";" EOL;
aText += "DegMax = ";
aText += TCollection_AsciiString(DegMax[Count]);
aText += ";" EOL;
aText += "Continuity = GeomAbs_C2" ;
aText += ";" EOL;
aText += "Tolerance = ";
aText += TCollection_AsciiString(Tol[Count]/SCALE);
aText += ";" EOL EOL ;
aText += (
"aPTB.Init(aCurvePoint,DegMin,DegMax,Continuity,Tolerance);" EOL
"Handle(Geom_BSplineCurve) aCurve = aPTB.Curve();" EOL
);
setResultTitle("Creating approximations of curves");
setResultText(aText.ToCString());
getAISContext()->EraseAll();
Standard_Real aCoords[][3] = {
{-6,1,0},{-5,1.5,0},{-4,2,0},{-3.5,3,0},{-3,2.7,0},{-2,2.5,0},{-1.5,1,0},{-1,0.5,0},
{0,0,0},{1,0.3,0},{2,1,0},{3,1.5,0},{4,2.3,0},{5,2.7,0},{5.5,3.2,0},{6,2.5,0},
{7,2,0},{7.5,1,0},{8,0,0},{8.5,-1,0}
};
Standard_Integer nPoint = sizeof(aCoords)/(sizeof(Standard_Real)*3);
TColgp_Array1OfPnt aCurvePoint (1, nPoint);
GeomAPI_PointsToBSpline aPTB;
Handle(AIS_InteractiveObject) aIndexPnt [2],aObj;
Standard_Integer aIndex[2] = {9,13};
Standard_Real aDeflection[2] = {-1.5,2};
for (Standard_Integer i=0; i < nPoint; i++)
{
aCurvePoint(i+1) = gp_Pnt (aCoords[i][0]*SCALE-100, aCoords[i][1]*SCALE-100, aCoords[i][2]*SCALE);
if( i+1 == aIndex[0])
aIndexPnt[0] = drawPoint(aCurvePoint(aIndex[0]));
if( i+1 == aIndex[1])
aIndexPnt[1] = drawPoint(aCurvePoint(aIndex[1]));
if( i+1 != aIndex[0] && i+1 != aIndex[1])
drawPoint(aCurvePoint(i+1));
}
if(WAIT_A_LITTLE) return;
aPTB.Init(aCurvePoint,DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
Handle(Geom_BSplineCurve) aCurve = aPTB.Curve();
aObj = drawCurve(aCurve);
for( i = 0 ; i < 2 ; i++)
{
if (WAIT_A_SECOND) return;
getAISContext()->Erase(aIndexPnt[i]);
aCurvePoint(aIndex[i]) = gp_Pnt(aCurvePoint(aIndex[i]).X()-SCALE*aDeflection[i],
aCurvePoint(aIndex[i]).Y()+SCALE*aDeflection[i],
aCurvePoint(aIndex[i]).Z());
aIndexPnt[i] = drawPoint(aCurvePoint(aIndex[i]));
aPTB.Init(aCurvePoint,DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
aCurve = aPTB.Curve();
if (WAIT_A_LITTLE) return;
getAISContext()->Erase(aObj);
aObj = drawCurve(aCurve);
}
}
//================================================================
// Function : Approx_Presentation::sample2
// Purpose :
//================================================================
void Approx_Presentation::sample2()
{
setResultTitle("Creating approximations of surfaces");
Standard_Integer Count = 1;
Standard_Real aZCoords [] =
{
{-1},{0},{0},{1},{0},{-1},{-1},{0},{0},{-1.5},{-2.5},{0},{1},{-2},{-3},{0}
};
Standard_Real aXStep = 175, aYStep = 175;
Standard_Real aX0 = -300, aY0 = -200;
Standard_Integer anUpper = 4;
TColStd_Array2OfReal aZPoints(1,anUpper,1,anUpper);
Standard_Integer aIndexX[] = { 4, 3, 2, 2, 1 };
Standard_Integer aIndexY[] = { 4, 3, 2, 3, 4 };
Standard_Real aDeflection[] = { 1.5, 2.5, 1.5, 1.5, -1 };
Standard_Integer aNumOfIndexPnt = sizeof(aIndexX)/sizeof(Standard_Integer);
TColgp_Array2OfPnt aPnt(1,4,1,4);
Handle(AIS_InteractiveObject) aShowPnt[4][4],aObj,aMovePnt;
Standard_Integer aColLength = aZPoints.ColLength();
Standard_Integer aRowLength = aZPoints.RowLength();
Standard_Integer aIndex = -1;
for(Standard_Integer i = 0 ; i < aRowLength ; i++)
{
for(Standard_Integer j = 0; j < aColLength ; j++)
{
aIndex++;
aZPoints(i+1,j+1) = aZCoords[aIndex];
}
}
Standard_Real auxY0,auxX0 = aX0 - aXStep;
for( i = 0 ; i < aColLength ; i++)
{
auxX0 += aXStep;
auxY0 = aY0 - aYStep;
for(Standard_Integer j = 0 ; j < aRowLength ; j++)
{
aZPoints(i+1,j+1) *=SCALE;
auxY0 += aYStep;
aPnt(i+1,j+1) = gp_Pnt (auxX0,auxY0,aZPoints(i+1,j+1));
aShowPnt[i][j] = drawPoint(aPnt(i+1,j+1));
}
}
if(WAIT_A_LITTLE) return ;
TCollection_AsciiString aText;
aText = Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
setResultText(aText.ToCString());
Handle(Geom_BSplineSurface) aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
aObj = drawSurface(aSurface);
Standard_Boolean aBool;
if(WAIT_A_LITTLE) return ;
for( i = 0 ; i < aNumOfIndexPnt ; i++)
{
aMovePnt = aShowPnt[aIndexX[i]-1][aIndexY[i]-1];
aBool = DrawModifyBSplineSurface(aZPoints,aXStep,aYStep,aIndexX[i],aIndexY[i],
aDeflection[i],aMovePnt,aObj,Count);
if(!aBool) return;
if( i < aNumOfIndexPnt - 1)
{
drawPoint(aPnt(aIndexX[i],aIndexY[i]));
getAISContext()->Erase(aMovePnt);
}
}
}
//================================================================
// Function : Approx_Presentation::sample3
// Purpose :
//================================================================
void Approx_Presentation::sample3()
{
setResultTitle("Creating approximations of surfaces");
Standard_Integer Count = 2;
Standard_Real aZCoords [] =
{
{-3},{-2.3},{-3},{-0.5},{-1},{-1},{-1},{-1},{0},{0},{0},{0},{1},{-1},{-1},{0}
};
Standard_Integer anUpper = 4;
TColStd_Array2OfReal aZPoints(1,anUpper,1,anUpper);
Standard_Integer aIndexX[] = {1, 2, 3, 4};
Standard_Integer aIndexY[] = {1, 2, 3, 4};
Standard_Real aDeflection[] = {1.5, 2, 1, 1.5};
Standard_Integer aNumOfIndexPnt = sizeof(aIndexX)/sizeof(Standard_Integer);
TColgp_Array2OfPnt aPnt(1,4,1,4);
Handle(AIS_InteractiveObject) aShowPnt[4][4],aObj,aMovePnt;
Standard_Integer aColLength = aZPoints.ColLength();
Standard_Integer aRowLength = aZPoints.RowLength();
Standard_Integer aIndex = -1;
for(Standard_Integer i = 0 ; i < aRowLength ; i++)
{
for(Standard_Integer j = 0; j < aColLength ; j++)
{
aIndex++;
aZPoints(i+1,j+1) = aZCoords[aIndex];
}
}
Standard_Real aXStep = 175, aYStep = 175;
Standard_Real aX0 = -300, aY0 = -200;
Standard_Real auxY0,auxX0 = aX0 - aXStep;
for( i = 0 ; i < aColLength ; i++)
{
auxX0 += aXStep;
auxY0 = aY0 - aYStep;
for(Standard_Integer j = 0 ; j < aRowLength ; j++)
{
aZPoints(i+1,j+1) *=SCALE;
auxY0 += aYStep;
aPnt(i+1,j+1) = gp_Pnt (auxX0,auxY0,aZPoints(i+1,j+1));
aShowPnt[i][j] = drawPoint(aPnt(i+1,j+1));
}
}
if(WAIT_A_LITTLE) return ;
TCollection_AsciiString aText;
aText += Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
setResultText(aText.ToCString());
Handle(Geom_BSplineSurface) aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
aObj = drawSurface(aSurface);
Standard_Boolean aBool;
if(WAIT_A_LITTLE) return ;
for( i = 0 ; i < aNumOfIndexPnt ; i++)
{
aMovePnt = aShowPnt[aIndexX[i]-1][aIndexY[i]-1];
aBool = DrawModifyBSplineSurface(aZPoints,aXStep,aYStep,aIndexX[i],aIndexY[i],
aDeflection[i],aMovePnt,aObj,Count);
if(!aBool) return;
if( i < aNumOfIndexPnt - 1)
{
drawPoint(aPnt(aIndexX[i],aIndexY[i]));
getAISContext()->Erase(aMovePnt);
}
}
}
//================================================================
// Function : Approx_Presentation::sample4
// Purpose :
//================================================================
void Approx_Presentation::sample4()
{
setResultTitle("Creating approximations of surfaces");
Standard_Integer Count = 3;
Standard_Real aZCoords [] =
{
{-1.5},{0.5},{1},{0.5},{-1.5},{0},{-0.5},{0},{-0.5},{0},{1},{-0.5},{0},{-0.5},{1},{0},{-0.5},
{0},{-0.5},{0},{-1.5},{0.5},{1},{0.5},{-1.5}
};
Standard_Integer anUpper = 5;
TColStd_Array2OfReal aZPoints(1,anUpper,1,anUpper);
Standard_Integer aIndexX[] = { 1, 3, 5 };
Standard_Integer aIndexY[] = { 3, 3, 3 };
Standard_Real aDeflection[] = {-2, 1, -2 };
Standard_Integer aNumOfIndexPnt = sizeof(aIndexX)/sizeof(Standard_Integer);
TColgp_Array2OfPnt aPnt(1,5,1,5);
Handle(AIS_InteractiveObject) aShowPnt[5][5],aObj,aMovePnt;
Standard_Integer aColLength = aZPoints.ColLength();
Standard_Integer aRowLength = aZPoints.RowLength();
Standard_Integer aIndex = -1;
for(Standard_Integer i = 0 ; i < aRowLength ; i++)
{
for(Standard_Integer j = 0; j < aColLength ; j++)
{
aIndex++;
aZPoints(i+1,j+1) = aZCoords[aIndex];
}
}
Standard_Real aXStep = 140, aYStep = 140;
Standard_Real aX0 = -300, aY0 = -200;
Standard_Real auxY0,auxX0 = aX0 - aXStep;
for( i = 0 ; i < aColLength ; i++)
{
auxX0 += aXStep;
auxY0 = aY0 - aYStep;
for(Standard_Integer j = 0 ; j < aRowLength ; j++)
{
aZPoints(i+1,j+1) *=SCALE;
auxY0 += aYStep;
aPnt(i+1,j+1) = gp_Pnt (auxX0,auxY0,aZPoints(i+1,j+1));
aShowPnt[i][j] = drawPoint(aPnt(i+1,j+1));
}
}
if(WAIT_A_LITTLE) return ;
TCollection_AsciiString aText;
aText += Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
setResultText(aText.ToCString());
Handle(Geom_BSplineSurface) aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
aObj = drawSurface(aSurface);
Standard_Boolean aBool;
if(WAIT_A_LITTLE) return ;
for( i = 0 ; i < aNumOfIndexPnt ; i++)
{
aMovePnt = aShowPnt[aIndexX[i]-1][aIndexY[i]-1];
aBool = DrawModifyBSplineSurface(aZPoints,aXStep,aYStep,aIndexX[i],aIndexY[i],
aDeflection[i],aMovePnt,aObj,Count);
if(!aBool) return;
if( i < aNumOfIndexPnt - 1)
{
drawPoint(aPnt(aIndexX[i],aIndexY[i]));
getAISContext()->Erase(aMovePnt);
}
}
}

View File

@ -1,50 +0,0 @@
// Approx_Presentation.h: interface for the Approx_Presentation class.
// Presentation class: Approximation of curves and surfaces.
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_Approx_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_Approx_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
#include <Geom_BSplineSurface.hxx>
class Approx_Presentation : public OCCDemo_Presentation
{
public:
// Construction
Approx_Presentation();
public:
// Iteration on samples
virtual void DoSample();
// one phase of iterations
private:
// Sample functions
void sample1();
void sample2();
void sample3();
void sample4();
Standard_Boolean DrawModifyBSplineSurface(TColStd_Array2OfReal& ,
Standard_Real ,Standard_Real ,
Standard_Integer ,Standard_Integer ,
Standard_Real,Handle(AIS_InteractiveObject)&,
Handle(AIS_InteractiveObject)&,
Standard_Integer);
Handle(Geom_BSplineSurface) CreateBSplineSurface(TColStd_Array2OfReal& ,
Standard_Real ,Standard_Real,
Standard_Integer);
private:
// Array of pointers to sample functions
typedef void (Approx_Presentation::*PSampleFuncType)();
static const PSampleFuncType SampleFuncs[];
};
#endif // !defined(AFX_Approx_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,428 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Chamfers"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/Chamfers.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Release/Chamfers.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/Chamfers.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/Chamfers.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/Chamfers.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBO.lib TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib"
OutputFile=".\../Debug/Chamfers.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/Chamfers.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/Chamfers.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="Chamfers_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="Chamfers_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,781 +0,0 @@
// Chamfers_Presentation.cpp: implementation of the Chamfers_Presentation class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Chamfers_Presentation.h"
#ifdef WNT
#pragma warning (disable : 4786)
#endif
#include <TopoDS_Edge.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepAlgo_Fuse.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
#include <BRepFilletAPI_MakeChamfer.hxx>
#include <BRepFilletAPI_MakeFillet.hxx>
#include <TopExp.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS.hxx>
#include <TopOpeBRepBuild_HBuilder.hxx>
#include <Precision.hxx>
#ifdef WNT
#define EOL "\r\n"
#else
#define EOL "\n"
#endif
#define BOX_SIDE_LEN 500
// Initialization of global variable with an instance of this class
OCCDemo_Presentation* OCCDemo_Presentation::Current = new Chamfers_Presentation;
// Initialization of array of samples
const Chamfers_Presentation::PSampleFuncType Chamfers_Presentation::SampleFuncs[] =
{
&Chamfers_Presentation::sampleBoxChamfer,
&Chamfers_Presentation::sampleBoxCylChamfer,
&Chamfers_Presentation::sampleBoxCylAngChamfer,
&Chamfers_Presentation::sampleBoxFillet,
&Chamfers_Presentation::sampleBoxCylFillet,
&Chamfers_Presentation::sampleBoxCylAngFillet
};
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Chamfers_Presentation::Chamfers_Presentation()
{
myIndex = 0;
myNbSamples = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
setName ("Chamfers and Fillets");
}
//////////////////////////////////////////////////////////////////////
// Sample execution
//////////////////////////////////////////////////////////////////////
void Chamfers_Presentation::DoSample()
{
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbSamples)
(this->*SampleFuncs[myIndex])();
}
//////////////////////////////////////////////////////////////////////
// Sample functions
//////////////////////////////////////////////////////////////////////
//================================================================
// Function : createDiverseChamferOnBox
// Purpose : makes chamfers of different size on 3 converging edges
// of the given box using given distances d1, d2, d3;
// outputs its own source code into result dialog
//================================================================
Standard_Boolean Chamfers_Presentation::createDiverseChamferOnBox(
TopoDS_Solid& aBox,
Standard_Real d1, // chamfer on edge 1
Standard_Real d2, // chamfer on edge 2
Standard_Real d3, // chamfer on edge 3
Handle(AIS_InteractiveObject)& thePrevShape)// for smoth drawing
// we display the new shape first, then erase the previous one
{
// initializing a class that builds chamfer
BRepFilletAPI_MakeChamfer aMakeChamfer(aBox);
// a map of "edge-to-list of faces". Key = edge, value = list of 2 faces
// of the box that "touch" the edge
TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;
// filling the map with edges and faces of the box
TopExp::MapShapesAndAncestors(aBox, TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);
// array of indexes of edges to be chamfered
int aEdgeInd[] = {6, 2, 10, 12, 5};
// creating chamfer on one of an edge of the top face, using d1
if (d1 > Precision::Confusion())
{
TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[0]));
TopoDS_Face aFace = TopoDS::Face(aMapOfEdgeToFaces.FindFromKey(anEdge).First());
aMakeChamfer.Add(d1, d1, anEdge, aFace);
}
// creating chamfer on the other 3 edges of the top face, using d2
if (d2 > Precision::Confusion())
{
for (Standard_Integer i = 1; i <= 3; i++)
{
TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[i]));
TopoDS_Face aFace = TopoDS::Face(aMapOfEdgeToFaces.FindFromKey(anEdge).First());
aMakeChamfer.Add(d2, d2, anEdge, aFace);
}
}
// creating chamfer on a vertical edge of box, using d3
if (d3 > Precision::Confusion())
{
TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[4]));
TopoDS_Face aFace = TopoDS::Face(aMapOfEdgeToFaces.FindFromKey(anEdge).First());
aMakeChamfer.Add(d3, d3, anEdge, aFace);
}
aMakeChamfer.Build();
if (aMakeChamfer.IsDone())
{
Handle(AIS_InteractiveObject) aNewShape = new AIS_Shape(aMakeChamfer.Shape());
getAISContext()->Erase(thePrevShape, Standard_False);
thePrevShape = aNewShape;
getAISContext()->Display(aNewShape);
}
TCollection_AsciiString aText;
aText = aText +
" // creating a box and centering it on the screen" EOL
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
" TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);" EOL EOL
" // initializing a class that builds chamfer" EOL
" BRepFilletAPI_MakeChamfer aMakeChamfer(aBox);" EOL EOL
" // a map of \"edge-to-list of faces\". Key = edge, value = list of 2 faces " EOL
" // of the box that \"touch\" the edge" EOL
" TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;" EOL
" // filling the map with edges and faces of the box" EOL
" TopExp::MapShapesAndAncestors(aBox, TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);" EOL
"" EOL
" Standard_Real d1 = "+TCollection_AsciiString(d1)+";" EOL
" Standard_Real d2 = "+TCollection_AsciiString(d2)+";" EOL
" Standard_Real d3 = "+TCollection_AsciiString(d3)+";" EOL
"" EOL
" // array of indexes of edges to be chamfered" EOL
" int aEdgeInd[] = {6, 2, 10, 12, 5};" EOL
"" EOL
" // creating chamfer on one of an edge of the top face, using d1" EOL
" if (d1 > Precision::Confusion())" EOL
" {" EOL
" TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[0]));" EOL
" TopoDS_Face aFace = TopoDS::Face(aMapOfEdgeToFaces.FindFromKey(anEdge).First());" EOL
" aMakeChamfer.Add(d1, d1, anEdge, aFace);" EOL
" }" EOL
"" EOL
" // creating chamfer on the other 3 edges of the top face, using d2" EOL
" if (d2 > Precision::Confusion())" EOL
" {" EOL
" for (Standard_Integer i = 1; i <= 3; i++)" EOL
" {" EOL
" TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[i]));" EOL
" TopoDS_Face aFace = TopoDS::Face(aMapOfEdgeToFaces.FindFromKey(anEdge).First());" EOL
" aMakeChamfer.Add(d2, d2, anEdge, aFace);" EOL
" }" EOL
" }" EOL
"" EOL
" // creating chamfer on a vertical edge of box, using d3" EOL
" if (d3 > Precision::Confusion())" EOL
" {" EOL
" TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[4]));" EOL
" TopoDS_Face aFace = TopoDS::Face(aMapOfEdgeToFaces.FindFromKey(anEdge).First());" EOL
" aMakeChamfer.Add(d3, d3, anEdge, aFace);" EOL
" }" EOL
" " EOL
" aMakeChamfer.Build();" EOL
" if (aMakeChamfer.IsDone())" EOL
" TopoDS_Shape aChamferedShape = aMakeChamfer.Shape();" EOL;
setResultText(aText.ToCString());
return WAIT_A_SECOND;
}
//================================================================
// Function : createChamferOnBox
// Purpose : makes chamfers on edges of the top face of the given box
// using given distances theDistA and theDistB, outputs its own
// source code into result dialog
//================================================================
Standard_Boolean Chamfers_Presentation::createChamferOnBox(
TopoDS_Solid& aBox,
Standard_Real theDistA, // distance along first face
Standard_Real theDistB, // distance along second face
Handle(AIS_InteractiveObject)& thePrevShape)// for smoth drawing
// we display the new shape first, then erase the previous one
{
// initializing a class that builds chamfer
BRepFilletAPI_MakeChamfer aMakeChamfer(aBox);
// a map of "edge-to-list of faces". Key = edge, value = list of 2 faces
// of the box that "touch" the edge
TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;
// filling the map with edges and faces of the box
TopExp::MapShapesAndAncestors(aBox, TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);
// array of indexes of edges to be chamfered
int aEdgeInd[] = {2, 6, 10, 12};
// building chamfers
for (int i = 0; i <= sizeof(aEdgeInd)/sizeof(int)-1; i++)
//for (int i = 1; i <= 12; i++) // uncomment to iterate through ALL edges of the box
{
TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[i]));
//TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(i));
// uncomment to iterate through ALL edges of the box
const TopTools_ListOfShape& aFaces = aMapOfEdgeToFaces.FindFromKey(anEdge);
TopoDS_Face aFace = TopoDS::Face(aFaces.First());
aMakeChamfer.Add(theDistA, theDistB, anEdge, aFace);
}
aMakeChamfer.Build();
if (aMakeChamfer.IsDone())
{
Handle(AIS_InteractiveObject) aNewShape = new AIS_Shape(aMakeChamfer.Shape());
getAISContext()->Erase(thePrevShape, Standard_False);
getAISContext()->Display(aNewShape, Standard_True);
thePrevShape = aNewShape;
}
TCollection_AsciiString aText;
aText = aText +
" // creating a box and centering it on the screen" EOL
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
" TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);" EOL EOL
" // initializing a class that builds chamfer" EOL
" BRepFilletAPI_MakeChamfer aMakeChamfer(aBox);" EOL EOL
" // a map of \"edge-to-list of faces\". Key = edge, value = list of 2 faces " EOL
" // of the box that \"touch\" the edge" EOL
" TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;" EOL
" // filling the map with edges and faces of the box" EOL
" TopExp::MapShapesAndAncestors(aBox, TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);" EOL
"" EOL
" Standard_Real aDistA = "+TCollection_AsciiString(theDistA)+";" EOL
" Standard_Real aDistB = "+TCollection_AsciiString(theDistB)+";" EOL
"" EOL
" // array of indexes of edges to be chamfered" EOL
" int aEdgeInd[] = {2, 6, 10, 12};" EOL EOL
" // building chamfers" EOL
" for (int i = 0; i <= sizeof(aEdgeInd)/sizeof(int)-1; i++)" EOL
" {" EOL
" TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[i]));" EOL
" const TopTools_ListOfShape& aFaces = aMapOfEdgeToFaces.FindFromKey(anEdge);" EOL
" TopoDS_Face aFace = TopoDS::Face(aFaces.First());" EOL
" // creating a chamfer with lengths aDistA, aDistB" EOL
" aMakeChamfer.Add(aDistA, aDistB, anEdge, aFace);" EOL
" }" EOL EOL
" aMakeChamfer.Build();" EOL
" if (aMakeChamfer.IsDone())" EOL
" TopoDS_Shape aChamferedShape = aMakeChamfer.Shape();" EOL;
setResultText(aText.ToCString());
return WAIT_A_SECOND;
}
//================================================================
// Function : createFilletOnBox
// Purpose : creates a box with side=10, makes fillets on some of its edges
// using given value of radius and shape of fillet, outputs its own
// source code into theText parameter
//================================================================
Standard_Boolean Chamfers_Presentation::createFilletOnBox(
TopoDS_Solid& aBox,
Standard_Real theRad, // radius of fillet
ChFi3d_FilletShape theFShape, // shape of fillet
Handle(AIS_InteractiveObject)& thePrevObj) // to erase
// the previous shape
{
// initializing a class that builds fillet
// second parameter is a shape of fillet:
// enum ChFi3d_FilletShape { ChFi3d_Rational, ChFi3d_QuasiAngular, ChFi3d_Polynomial };
BRepFilletAPI_MakeFillet aMakeFillet(aBox, theFShape);
// a map of edges
TopTools_IndexedMapOfShape aMapOfEdges;
// filling the map with edges of the box
TopExp::MapShapes(aBox, TopAbs_EDGE, aMapOfEdges);
// array of indexes of edges to be chamfered
int aEdgeInd[] = {2, 6, 10, 12};
// adding edges that will have fillet
for (int i = 0; i <= sizeof(aEdgeInd)/sizeof(int)-1; i++)
{
TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdges(aEdgeInd[i]));
aMakeFillet.Add(theRad, anEdge);
}
aMakeFillet.Build();
if (aMakeFillet.IsDone())
{
Handle(AIS_InteractiveObject) aNewShape = new AIS_Shape(aMakeFillet.Shape());
getAISContext()->Erase(thePrevObj, Standard_False);
getAISContext()->Display(aNewShape, Standard_True);
thePrevObj = aNewShape;
}
// calculating the string corresponding to theFShape
TCollection_AsciiString aFShapeStr;
aFShapeStr = ((theFShape==ChFi3d_Rational)? "ChFi3d_Rational":
((theFShape==ChFi3d_QuasiAngular)? "ChFi3d_QuasiAngular":
"ChFi3d_Polynomial"));
TCollection_AsciiString aText;
aText = aText +
" // creating a box and centering it on the screen" EOL
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
" TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);" EOL
" " EOL
" // initializing a class that builds fillet" EOL
" // second parameter is a shape of fillet:" EOL
" // enum ChFi3d_FilletShape { ChFi3d_Rational, ChFi3d_QuasiAngular, ChFi3d_Polynomial };" EOL
" BRepFilletAPI_MakeFillet aMakeFillet(aBox, "+aFShapeStr+");" EOL
" " EOL
" // a map of edges" EOL
" TopTools_IndexedMapOfShape aMapOfEdges;" EOL
" // filling the map with edges of the box" EOL
" TopExp::MapShapes(aBox, TopAbs_EDGE, aMapOfEdges);" EOL EOL
" // array of indexes of edges to be chamfered" EOL
" int aEdgeInd[] = {2, 6, 10, 12};" EOL EOL
" // adding edges that will have fillet" EOL
" Standard_Real r = "+TCollection_AsciiString(theRad)+";" EOL
" for (int i = 0; i <= sizeof(aEdgeInd)/sizeof(int)-1; i++)" EOL
" {" EOL
" TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdges(aEdgeInd[i]));" EOL
" aMakeFillet.Add(r, anEdge);" EOL
" }" EOL
" aMakeFillet.Build();" EOL
" if (aMakeFillet.IsDone())" EOL
" TopoDS_Shape aShapeWithFillet = aMakeFillet.Shape();" EOL;
setResultText(aText.ToCString());
return WAIT_A_SECOND;
}
// ===============================================================
// CHAMFER CASES
// ===============================================================
//================================================================
// Function : Chamfers_Presentation::sampleBoxChamfer1,2,3
// Purpose :
//================================================================
void Chamfers_Presentation::sampleBoxChamfer()
{
setResultTitle("Creating Chamfer");
TCollection_AsciiString aText;
aText = aText +
" // creating a box and centering it on the screen" EOL
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
" TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);" EOL;
setResultText(aText.ToCString());
// show initial shape
Standard_Real a = BOX_SIDE_LEN;
TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);
Handle(AIS_InteractiveObject) aPrevShape = new AIS_Shape(aBox);
getAISContext()->Display(aPrevShape, Standard_False);
COCCDemoDoc::Fit();
if (WAIT_A_SECOND) return;
// show several chamfers
if (createChamferOnBox(aBox, a/10, a/10, aPrevShape)) return;
if (createChamferOnBox(aBox, a/24, a/10, aPrevShape)) return;
if (createChamferOnBox(aBox, a/10, a/10, aPrevShape)) return;
if (createChamferOnBox(aBox, a/10, a/24, aPrevShape)) return;
if (createChamferOnBox(aBox, a/10, a/10, aPrevShape)) return;
if (createDiverseChamferOnBox(aBox, a/6, a/10, 0, aPrevShape)) return;
if (createDiverseChamferOnBox(aBox, a/6, a/10, a/24, aPrevShape)) return;
}
//================================================================
// Function : Chamfers_Presentation::sampleBoxCylChamfer
// Purpose : creates a more complecated chamfer on a shape created
// by fusing box and cylinder
//================================================================
void Chamfers_Presentation::sampleBoxCylChamfer()
{
setResultTitle("Creating Chamfer");
TCollection_AsciiString aText;
aText = aText +
" // creating a shape, a result of fusing of a box and cylinder" EOL
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
" Standard_Real b = a/2;" EOL
" BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);" EOL
" BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)), a/4, a);" EOL
" BRepAlgoAPI_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());" EOL
" aFuser.Build();" EOL EOL
" // initializing a class that builds chamfer" EOL
" BRepFilletAPI_MakeChamfer aMakeChamfer(aFuser.Shape());" EOL EOL
" // a map of \"edge-to-list of faces\". Key = edge, value = list of 2 faces " EOL
" // of the box that \"touch\" the edge" EOL
" TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;" EOL
" // filling the map with edges and faces of the box" EOL
" TopExp::MapShapesAndAncestors(aFuser.Shape(), TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);" EOL EOL
" // retrieving list of edges to build a chamfer on - edges of " EOL
" // intersection of the cylinder and the box" EOL
" const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();" EOL
" TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);" EOL
"" EOL
" // creating fillet on edge intersection edges" EOL
" Standard_Real d = a/20;" EOL
" for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())" EOL
" {" EOL
" TopoDS_Edge anEdge = TopoDS::Edge(anIntersectionEdgesIt.Value());" EOL
" if (!aMapOfEdgeToFaces.Contains(anEdge)) continue;" EOL
" const TopTools_ListOfShape& aFaces = aMapOfEdgeToFaces.FindFromKey(anEdge);" EOL
" TopoDS_Face aFace = TopoDS::Face(aFaces.First());" EOL
" aMakeChamfer.Add(d, d, anEdge, aFace);" EOL
" }" EOL
" " EOL
" aMakeChamfer.Build();" EOL
" if (aMakeChamfer.IsDone())" EOL
" TopoDS_Shape aChamferedShape = aMakeChamfer.Shape();" EOL;
setResultText(aText.ToCString());
// creating a shape, a result of fusing of a box and cylinder
Standard_Real a = BOX_SIDE_LEN;
Standard_Real b = a/2;
BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);
BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)), a/4, a);
BRepAlgo_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());
aFuser.Build();
Handle(AIS_InteractiveObject) aPrevObj = new AIS_Shape(aFuser.Shape());
getAISContext()->Display(aPrevObj, Standard_False);
COCCDemoDoc::Fit();
if (WAIT_A_SECOND) return;
// initializing a class that builds chamfer
BRepFilletAPI_MakeChamfer aMakeChamfer(aFuser.Shape());
// a map of "edge-to-list of faces". Key = edge, value = list of 2 faces
// of the box that "touch" the edge
TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;
// filling the map with edges and faces of the box
TopExp::MapShapesAndAncestors(aFuser.Shape(), TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);
// retrieving list of edges to build a chamfer on - edges of
// intersection of the cylinder and the box
const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();
TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);
// creating fillet on edge intersection edges
Standard_Real d = a/20;
for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(anIntersectionEdgesIt.Value());
if (!aMapOfEdgeToFaces.Contains(anEdge)) continue;
const TopTools_ListOfShape& aFaces = aMapOfEdgeToFaces.FindFromKey(anEdge);
TopoDS_Face aFace = TopoDS::Face(aFaces.First());
aMakeChamfer.Add(d, d, anEdge, aFace);
}
aMakeChamfer.Build();
if (aMakeChamfer.IsDone())
{
getAISContext()->Erase(aPrevObj, Standard_False);
getAISContext()->Display(new AIS_Shape(aMakeChamfer.Shape()));
//aPrevObj = aNewShape;// uncomment if further thePrevObj is used
}
}
//================================================================
// Function : Chamfers_Presentation::sampleBoxCylAngChamfer
// Purpose : creates a more complecated chamfer on a shape created
// by fusing box and cylinder
//================================================================
void Chamfers_Presentation::sampleBoxCylAngChamfer()
{
setResultTitle("Creating Chamfer");
TCollection_AsciiString aText;
aText = aText +
" // creating a shape, a result of fusing of a box and cylinder" EOL
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
" Standard_Real b = a/2;" EOL
" BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);" EOL
" BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,-0.4,0.6)), a/4, a);" EOL
" BRepAlgoAPI_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());" EOL
" aFuser.Build();" EOL EOL
" // initializing a class that builds chamfer" EOL
" BRepFilletAPI_MakeChamfer aMakeChamfer(aFuser.Shape());" EOL EOL
" // a map of \"edge-to-list of faces\". Key = edge, value = list of 2 faces " EOL
" // of the box that \"touch\" the edge" EOL
" TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;" EOL
" // filling the map with edges and faces of the box" EOL
" TopExp::MapShapesAndAncestors(aFuser.Shape(), TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);" EOL EOL
" // retrieving list of edges to build a chamfer on - edges of " EOL
" // intersection of the cylinder and the box" EOL
" const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();" EOL
" TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);" EOL EOL
" // creating chamfer on intersection edges" EOL
" Standard_Real d = a/20;" EOL
" for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())" EOL
" {" EOL
" TopoDS_Edge anEdge = TopoDS::Edge(anIntersectionEdgesIt.Value());" EOL
" if (!aMapOfEdgeToFaces.Contains(anEdge)) continue;" EOL
" const TopTools_ListOfShape& aFaces = aMapOfEdgeToFaces.FindFromKey(anEdge);" EOL
" TopoDS_Face aFace = TopoDS::Face(aFaces.First());" EOL
" aMakeChamfer.Add(d, d, anEdge, aFace);" EOL
" }" EOL EOL
" aMakeChamfer.Build();" EOL
" if (aMakeChamfer.IsDone())" EOL
" TopoDS_Shape aChamferedShape = aMakeChamfer.Shape();" EOL;
setResultText(aText.ToCString());
// creating a shape, a result of fusing of a box and cylinder
Standard_Real a = BOX_SIDE_LEN;
Standard_Real b = a/2;
BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);
BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,-0.4,0.6)), a/4, a);
BRepAlgo_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());
aFuser.Build();
Handle(AIS_InteractiveObject) aPrevObj = new AIS_Shape(aFuser.Shape());
getAISContext()->Display(aPrevObj, Standard_False);
COCCDemoDoc::Fit();
if (WAIT_A_SECOND) return;
// initializing a class that builds chamfer
BRepFilletAPI_MakeChamfer aMakeChamfer(aFuser.Shape());
// a map of "edge-to-list of faces". Key = edge, value = list of 2 faces
// of the box that "touch" the edge
TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;
// filling the map with edges and faces of the box
TopExp::MapShapesAndAncestors(aFuser.Shape(), TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);
// retrieving list of edges to build a chamfer on - edges of
// intersection of the cylinder and the box
const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();
TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);
// creating fillet on edge intersection edges
Standard_Real d = a/20;
for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(anIntersectionEdgesIt.Value());
if (!aMapOfEdgeToFaces.Contains(anEdge)) continue;
const TopTools_ListOfShape& aFaces = aMapOfEdgeToFaces.FindFromKey(anEdge);
TopoDS_Face aFace = TopoDS::Face(aFaces.First());
aMakeChamfer.Add(d, d, anEdge, aFace);
}
aMakeChamfer.Build();
if (aMakeChamfer.IsDone())
{
getAISContext()->Erase(aPrevObj, Standard_False);
getAISContext()->Display(new AIS_Shape(aMakeChamfer.Shape()));
//thePrevShape = aNewShape;// uncomment if further thePrevObj is used
}
}
// ===============================================================
// FILLET CASES
// ===============================================================
//================================================================
// Function : Chamfers_Presentation::sampleBoxFillet1,2,3
// Purpose :
//================================================================
void Chamfers_Presentation::sampleBoxFillet()
{
setResultTitle("Creating Fillet");
TCollection_AsciiString aText;
aText = aText +
" // creating a box and centering it on the screen" EOL
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
" TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);" EOL;
setResultText(aText.ToCString());
// show initial shape
Standard_Real a = BOX_SIDE_LEN;
TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);
Handle(AIS_InteractiveObject) aPrevObj = new AIS_Shape(aBox);
getAISContext()->Display(aPrevObj, Standard_False);
COCCDemoDoc::Fit();
if (WAIT_A_SECOND) return;
// show several fillets
if (createFilletOnBox(aBox, a/10, ChFi3d_Polynomial, aPrevObj)) return;
if (createFilletOnBox(aBox, a/5, ChFi3d_QuasiAngular, aPrevObj)) return;
if (createFilletOnBox(aBox, a/3.3, ChFi3d_Rational, aPrevObj)) return;
}
//================================================================
// Function : Chamfers_Presentation::sampleBoxCylFillet
// Purpose : creates a more complecated chamfer on a shape created
// by fusing box and cylinder
//================================================================
void Chamfers_Presentation::sampleBoxCylFillet()
{
setResultTitle("Creating Fillet");
TCollection_AsciiString aText;
aText = aText +
" // creating a shape - result of fusing a box and a cylinder" EOL
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
" Standard_Real b = a/2;" EOL
" BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);" EOL
" BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)), a/4, a);" EOL
" BRepAlgoAPI_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());" EOL
" aFuser.Build();" EOL EOL
" // initializing a class that builds fillet" EOL
" // second parameter is a shape of fillet:" EOL
" // enum ChFi3d_FilletShape { ChFi3d_Rational, ChFi3d_QuasiAngular, ChFi3d_Polynomial };" EOL
" BRepFilletAPI_MakeFillet aMakeFillet(aFuser.Shape(), ChFi3d_Rational);" EOL EOL
" // retrieving list of edges to build a chamfer on - edges of " EOL
" // intersection of the cylinder and the box" EOL
" const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();" EOL
" TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);" EOL EOL
" // creating fillet on edge intersection edges" EOL
" Standard_Real d = a/10;" EOL
" for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())" EOL
" aMakeFillet.Add(d, TopoDS::Edge(anIntersectionEdgesIt.Value()));" EOL
"" EOL
" aMakeFillet.Build();" EOL EOL
" if (aMakeFillet.IsDone())" EOL
" TopoDS_Shape aShapeWithFillet = aMakeFillet.Shape();" EOL;
setResultText(aText.ToCString());
// creating a shape, a result of fusing of a box and cylinder
Standard_Real a = BOX_SIDE_LEN;
Standard_Real b = a/2;
BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);
BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)), a/4, a);
BRepAlgo_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());
aFuser.Build();
Handle(AIS_InteractiveObject) aPrevObj = new AIS_Shape(aFuser.Shape());
getAISContext()->Display(aPrevObj, Standard_False);
COCCDemoDoc::Fit();
if (WAIT_A_SECOND) return;
// initializing a class that builds fillet
// second parameter is a shape of fillet:
// enum ChFi3d_FilletShape { ChFi3d_Rational, ChFi3d_QuasiAngular, ChFi3d_Polynomial };
BRepFilletAPI_MakeFillet aMakeFillet(aFuser.Shape(), ChFi3d_Rational);
// retrieving list of edges to build a chamfer on - edges of
// intersection of the cylinder and the box
const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();
TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);
// creating fillet on edge intersection edges
Standard_Real d = a/10;
for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())
aMakeFillet.Add(d, TopoDS::Edge(anIntersectionEdgesIt.Value()));
aMakeFillet.Build();
if (aMakeFillet.IsDone())
{
getAISContext()->Erase(aPrevObj, Standard_False);
//aPrevObj = new AIS_Shape(aMakeFillet.Shape());// uncomment if aPrevObj is used further
getAISContext()->Display(new AIS_Shape(aMakeFillet.Shape()));
}
}
//================================================================
// Function : Chamfers_Presentation::sampleBoxCylAngFillet
// Purpose : creates a fillet on a more complecated shape created
// by fusing box and cylinder
//================================================================
void Chamfers_Presentation::sampleBoxCylAngFillet()
{
setResultTitle("Creating Fillet");
TCollection_AsciiString aText;
aText = aText +
" // creating a shape - result of fusing a box and a cylinder" EOL
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
" Standard_Real b = a/2;" EOL
" BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);" EOL
" BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,-0.4,0.6)), a/4, a);" EOL
" BRepAlgoAPI_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());" EOL
" aFuser.Build();" EOL EOL
" // initializing a class that builds fillet" EOL
" // second parameter is a shape of fillet:" EOL
" // enum ChFi3d_FilletShape { ChFi3d_Rational, ChFi3d_QuasiAngular, ChFi3d_Polynomial };" EOL
" BRepFilletAPI_MakeFillet aMakeFillet(aFuser.Shape(), ChFi3d_Rational);" EOL EOL
" // retrieving list of edges to build a chamfer on - edges of " EOL
" // intersection of the cylinder and the box" EOL
" const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();" EOL
" TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);" EOL EOL
" // creating fillet on intersection edges" EOL
" Standard_Real d = a/10;" EOL
" for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())" EOL
" aMakeFillet.Add(d, TopoDS::Edge(anIntersectionEdgesIt.Value()));" EOL
" aMakeFillet.Build();" EOL EOL
" if (aMakeFillet.IsDone())" EOL
" TopoDS_Shape aShapeWithFillet = aMakeFillet.Shape();" EOL;
setResultText(aText.ToCString());
// creating a shape, a result of fusing of a box and cylinder
Standard_Real a = BOX_SIDE_LEN;
Standard_Real b = a/2;
BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);
BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,-0.4,0.6)), a/4, a);
BRepAlgo_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());
aFuser.Build();
Handle(AIS_InteractiveObject) aPrevObj = new AIS_Shape(aFuser.Shape());
getAISContext()->Display(aPrevObj, Standard_False);
COCCDemoDoc::Fit();
if (WAIT_A_SECOND) return;
// initializing a class that builds fillet
// second parameter is a shape of fillet:
// enum ChFi3d_FilletShape { ChFi3d_Rational, ChFi3d_QuasiAngular, ChFi3d_Polynomial };
BRepFilletAPI_MakeFillet aMakeFillet(aFuser.Shape(), ChFi3d_Rational);
// retrieving list of edges to build a chamfer on - edges of
// intersection of the cylinder and the box
const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();
TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);
// creating fillet on edge intersection edges
Standard_Real d = a/10;
for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())
aMakeFillet.Add(d, TopoDS::Edge(anIntersectionEdgesIt.Value()));
aMakeFillet.Build();
if (aMakeFillet.IsDone())
{
getAISContext()->Erase(aPrevObj, Standard_False);
//aPrevObj = new AIS_Shape(aMakeFillet.Shape());// uncomment if aPrevObj is used further
getAISContext()->Display(new AIS_Shape(aMakeFillet.Shape()));
}
}

View File

@ -1,57 +0,0 @@
// Chamfers_Presentation.h: interface for the Chamfers_Presentation class.
// Presentation class: Example on chamfers and fillets
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_Chamfers_PRESENTATION_H)
#define AFX_Chamfers_PRESENTATION_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
#include <ChFi3d_FilletShape.hxx>
class AIS_InteractiveObject;
class TopoDS_Solid;
class Chamfers_Presentation : public OCCDemo_Presentation
{
public:
// Construction
Chamfers_Presentation();
public:
// Iteration on samples
virtual void DoSample();
// one phase of iterations
private:
Standard_Boolean createChamferOnBox(
TopoDS_Solid&, Standard_Real, Standard_Real,
Handle(AIS_InteractiveObject)&);
Standard_Boolean createDiverseChamferOnBox(
TopoDS_Solid&, Standard_Real, Standard_Real,
Standard_Real, Handle(AIS_InteractiveObject)&);
Standard_Boolean createFilletOnBox(
TopoDS_Solid&, Standard_Real, ChFi3d_FilletShape,
Handle(AIS_InteractiveObject)&);
// Sample functions
void sampleBoxChamfer();
void sampleBoxFillet();
void sampleBoxCylChamfer();
void sampleBoxCylAngChamfer();
void sampleBoxCylFillet();
void sampleBoxCylAngFillet();
private:
// Array of pointers to sample functions
typedef void (Chamfers_Presentation::*PSampleFuncType)();
static const PSampleFuncType SampleFuncs[];
};
#endif // !defined(AFX_Chamfers_PRESENTATION_H)

View File

@ -1,77 +0,0 @@
// ISession_Curve.cpp: implementation of the ISession_Curve class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ISession_Curve.h"
#include <Prs3d_LineAspect.hxx>
#include <StdPrs_Curve.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_ArrowAspect.hxx>
//
// Foreach ancestors, we add a IMPLEMENT_STANDARD_SUPERTYPE and
// a IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY macro.
// We must respect the order: from the direct ancestor class
// to the base class.
//
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
ISession_Curve::ISession_Curve(const Handle(Geom_Curve)& aCurve)
:AIS_InteractiveObject(),myCurve(aCurve)
{
}
ISession_Curve::~ISession_Curve()
{
}
void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer /*aMode*/)
{
GeomAdaptor_Curve anAdaptorCurve(myCurve);
if (hasOwnColor)
myDrawer->LineAspect()->SetColor (myDrawer->Color());
myDrawer->Link()->SetDiscretisation(100);
myDrawer->Link()->SetMaximalParameterValue(500);
StdPrs_Curve::Add (aPresentation, anAdaptorCurve, myDrawer);
}
void ISession_Curve::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
{
}
void ISession_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer aMode)
{
}

View File

@ -1,33 +0,0 @@
// ISession_Curve.h: interface for the ISession_Curve class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_ISESSION_CURVE_H__F981CB93_A3CC_11D1_8DA3_0800369C8A03__INCLUDED_)
#define AFX_ISESSION_CURVE_H__F981CB93_A3CC_11D1_8DA3_0800369C8A03__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <Standard_Macro.hxx>
#include <Standard_DefineHandle.hxx>
#include <AIS_InteractiveObject.hxx>
#include <Geom_Curve.hxx>
DEFINE_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
class ISession_Curve : public AIS_InteractiveObject
{
public:
ISession_Curve(const Handle(Geom_Curve)& aCurve);
virtual ~ISession_Curve();
DEFINE_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject)
private:
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
Standard_EXPORT virtual void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation) ;
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
Handle(Geom_Curve) myCurve;
};
#endif // !defined(AFX_ISESSION_CURVE_H__F981CB93_A3CC_11D1_8DA3_0800369C8A03__INCLUDED_)

View File

@ -1,314 +0,0 @@
// OCCDemo_Presentation.cpp: implementation of the OCCDemo_Presentation class.
// This is a base class for all presentations
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "OCCDemo_Presentation.h"
#include "OCCDemoView.h"
#include "ISession_Curve.h"
#include <AIS_InteractiveObject.hxx>
#include <Geom_Surface.hxx>
#include <Geom_Curve.hxx>
#include <Geom2d_Curve.hxx>
#include <Quantity_Color.hxx>
#include <AIS_Shape.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <Precision.hxx>
#include <Geom_Line.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Prs_Drawer.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <AIS_Point.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom2d_OffsetCurve.hxx>
#include <GeomAPI.hxx>
#include <gp_Pln.hxx>
#include <Geom_OffsetCurve.hxx>
#define MAX_PARAM 1000 // if a surface parameter is infinite, it is assingned
// this value in order to display the "infinit" object in the viewer.
Standard_Boolean OCCDemo_Presentation::WaitForInput (unsigned long aMilliSeconds)
{
//::WaitForSingleObject(::CreateEvent (NULL, FALSE, FALSE, NULL), aMilliSeconds);
if (::MsgWaitForMultipleObjects(0, NULL, FALSE, aMilliSeconds,
QS_KEY | QS_MOUSEBUTTON) != WAIT_TIMEOUT)
{
MSG msg;
if (::PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
{
if (msg.message == WM_KEYUP)
{
::PeekMessage (&msg, NULL, 0, 0, PM_REMOVE);
return WaitForInput (aMilliSeconds);
}
else
return Standard_True;
}
}
return Standard_False;
}
//================================================================
// Function : fixParam
// Purpose : assings a finite value to theParam if it intinite
// (equal to +- Precision::Infinite())
//================================================================
static Standard_Boolean fixParam(Standard_Real& theParam)
{
Standard_Boolean aResult = Standard_False;
if (Precision::IsNegativeInfinite(theParam))
{
theParam = -MAX_PARAM;
aResult = Standard_True;
}
if (Precision::IsPositiveInfinite(theParam))
{
theParam = MAX_PARAM;
aResult = Standard_True;
}
return aResult;
}
//================================================================
// Function : DrawSurface
// Purpose : displays a given geometric surface in 3d viewer
// (creates a finite face and displays it)
//================================================================
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawSurface
(const Handle(Geom_Surface)& theSurface,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay)
{
Standard_Real u1, u2, v1, v2;
theSurface->Bounds(u1,u2,v1,v2);
fixParam(u1);
fixParam(u2);
fixParam(v1);
fixParam(v2);
Handle(AIS_Shape) aGraphicSurface =
new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2));
getAISContext()->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
getAISContext()->SetColor(aGraphicSurface, theColor, toDisplay);
if (toDisplay) {
if (FitMode){
getAISContext()->Display (aGraphicSurface, Standard_False);
COCCDemoDoc::Fit();
}
else
getAISContext()->Display (aGraphicSurface);
}
return aGraphicSurface;
}
//================================================================
// Function : DrawCurve
// Purpose : displays a given curve 3d
//================================================================
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
(const Handle(Geom_Curve)& theCurve,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay)
{
Handle(ISession_Curve) aGraphicCurve = new ISession_Curve (theCurve);
getAISContext()->SetColor (aGraphicCurve, theColor, toDisplay);
aGraphicCurve->Attributes()->Link()->SetLineArrowDraw(Standard_False);
if (toDisplay){
if (FitMode){
getAISContext()->Display (aGraphicCurve, Standard_False);
COCCDemoDoc::Fit();
}
else
getAISContext()->Display (aGraphicCurve);
}
return aGraphicCurve;
}
//================================================================
// Function : DrawCurve
// Purpose : displays a given curve 2d
//================================================================
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
(const Handle(Geom2d_Curve)& theCurve,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay,
const gp_Ax2& aPosition)
{
// create 3D curve in plane
Handle(Geom_Curve) aCurve3d;
if (theCurve->IsKind(STANDARD_TYPE(Geom2d_OffsetCurve)))
{
Handle(Geom2d_OffsetCurve) aOffCurve =
Handle(Geom2d_OffsetCurve)::DownCast(theCurve);
Handle(Geom_Curve) aBasCurve3d =
GeomAPI::To3d (aOffCurve->BasisCurve(), gp_Pln(aPosition));
Standard_Real aDist = aOffCurve->Offset();
aCurve3d = new Geom_OffsetCurve (aBasCurve3d, aDist, aPosition.Direction());
}
else
{
aCurve3d = GeomAPI::To3d (theCurve, gp_Pln(aPosition));
}
return drawCurve (aCurve3d, theColor, toDisplay);
}
//================================================================
// Function : drawPoint
// Purpose : displays a given point
//================================================================
Handle(AIS_Point) OCCDemo_Presentation::drawPoint
(const gp_Pnt& aPnt,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay)
{
Handle(AIS_Point) aGraphicPoint = new AIS_Point (new Geom_CartesianPoint(aPnt));
getAISContext()->SetColor (aGraphicPoint, theColor, toDisplay);
if (toDisplay) {
getAISContext()->Display (aGraphicPoint);
//COCCDemoDoc::Fit();
}
return aGraphicPoint;
}
//================================================================
// Function : drawVector
// Purpose : displays a given vector in 3d viewer
// (segment of line starting at thePnt with the arrow at the end,
// the length of segment is the length of the vector)
//================================================================
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawVector
(const gp_Pnt& thePnt,
const gp_Vec& theVec,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay)
{
Standard_Real aLength = theVec.Magnitude();
if (aLength < Precision::Confusion())
return Handle(AIS_InteractiveObject)();
Handle(Geom_Curve) aCurve = new Geom_Line (thePnt, theVec);
aCurve = new Geom_TrimmedCurve (aCurve, 0, aLength);
Handle(ISession_Curve) aGraphicCurve = new ISession_Curve (aCurve);
getAISContext()->SetColor (aGraphicCurve, theColor, toDisplay);
Handle(Prs3d_Drawer) aDrawer = aGraphicCurve->Attributes()->Link();
aDrawer->SetLineArrowDraw(Standard_True);
aDrawer->ArrowAspect()->SetLength(aLength/10);
if (toDisplay) {
if (FitMode){
getAISContext()->Display (aGraphicCurve, Standard_False);
COCCDemoDoc::Fit();
}
else
getAISContext()->Display (aGraphicCurve);
}
return aGraphicCurve;
}
Handle(AIS_Shape) OCCDemo_Presentation::drawShape
(const TopoDS_Shape& theShape,const Quantity_Color& theColor,
const Standard_Boolean toDisplay)
{
Handle(AIS_Shape) aGraphicShape = new AIS_Shape(theShape);
getAISContext()->SetMaterial(aGraphicShape, Graphic3d_NOM_PLASTIC, toDisplay);
getAISContext()->SetColor (aGraphicShape, theColor, toDisplay);
if (toDisplay){
if (FitMode){
getAISContext()->Display (aGraphicShape, Standard_False);
COCCDemoDoc::Fit();
}
else
getAISContext()->Display (aGraphicShape);
}
return aGraphicShape;
}
Handle(AIS_Shape) OCCDemo_Presentation::drawShape
(const TopoDS_Shape& theShape,
const Graphic3d_NameOfMaterial theMaterial,
const Standard_Boolean toDisplay)
{
Handle(AIS_Shape) aGraphicShape = new AIS_Shape(theShape);
getAISContext()->SetMaterial(aGraphicShape, theMaterial, toDisplay);
if (toDisplay) {
if (FitMode){
getAISContext()->Display (aGraphicShape, Standard_False);
COCCDemoDoc::Fit();
}
else
getAISContext()->Display (aGraphicShape);
}
return aGraphicShape;
}
void OCCDemo_Presentation::GetViewCenter(Standard_Real& Xc, Standard_Real& Yc)
{
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
pView->GetViewCenter(Xc,Yc);
}
void OCCDemo_Presentation::SetViewCenter(Standard_Real Xc, Standard_Real Yc)
{
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
pView->SetViewCenter(Xc,Yc);
}
void OCCDemo_Presentation::GetViewEye(Standard_Real& X, Standard_Real& Y, Standard_Real& Z)
{
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
pView->GetViewEye(X,Y,Z);
}
void OCCDemo_Presentation::SetViewEye(Standard_Real X, Standard_Real Y, Standard_Real Z)
{
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
pView->SetViewEye(X,Y,Z);
}
Standard_Real OCCDemo_Presentation::GetViewScale()
{
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
return pView->GetViewScale();
}
void OCCDemo_Presentation::SetViewScale(Standard_Real Coef)
{
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
pView->SetViewScale(Coef);
}
void OCCDemo_Presentation::ResetView()
{
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
pView->Reset();
}

View File

@ -1,132 +0,0 @@
// OCCDemo_Presentation.h: interface for the OCCDemo_Presentation class.
// This is a base class for all presentations
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_OCCDEMO_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_OCCDEMO_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define WAIT_A_LITTLE WaitForInput(500)
#define WAIT_A_SECOND WaitForInput(1000)
#include <OCCDemoDoc.h>
class AIS_InteractiveObject;
class Geom_Surface;
class Geom_Curve;
class Geom2d_Curve;
class Quantity_Color;
class OCCDemo_Presentation
{
public:
// Construction
OCCDemo_Presentation() : myIndex(0), myNbSamples(0), FitMode(false){}
virtual ~OCCDemo_Presentation() {}
public:
static OCCDemo_Presentation* Current;
// this pointer must be initialized when realize a derivable class;
// it is used by application to access to a presentation class instance
void SetDocument (COCCDemoDoc* theDoc) {myDoc = theDoc;}
// document must be set by the user of this class before first use of iterations
public:
// Titling
const CString& GetName() const {return myName;}
public:
// Iteration on samples
void FirstSample() {myIndex=0;}
void LastSample() {myIndex=myNbSamples-1;}
Standard_Boolean AtFirstSample() const {return myIndex <= 0;}
Standard_Boolean AtLastSample() const {return myIndex >= myNbSamples-1;}
void NextSample() {myIndex++;}
void PrevSample() {myIndex--;}
virtual void DoSample() = 0;
static void GetViewCenter(Standard_Real& Xc, Standard_Real& Yc);
static void SetViewCenter(const Standard_Real Xc, const Standard_Real Yc);
static void GetViewEye(Standard_Real& X, Standard_Real& Y, Standard_Real& Z);
static void SetViewEye(Standard_Real X, Standard_Real Y, Standard_Real Z);
static Standard_Real GetViewScale();
static void SetViewScale(Standard_Real Coef);
static void ResetView();
// place one-time initialization code in this function
virtual void Init() {}
protected:
// Methods to call from a derivable class
void setName (const char* theName) {myName = CString(theName);}
Handle(AIS_InteractiveContext) getAISContext() const {return myDoc->GetAISContext();}
Handle(V3d_Viewer) getViewer() const {return myDoc->GetViewer();}
void setResultTitle (const char* theTitle) {myDoc->GetResultDialog()->SetTitle(theTitle);}
void setResultText (const char* theText) {myDoc->GetResultDialog()->SetText(theText);}
Standard_CString GetDataDir() {return myDoc->GetDataDir();}
Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
// Waits for a user input or a period of time has been elapsed
Handle(AIS_InteractiveObject) drawSurface (const Handle(Geom_Surface)& theSurface,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_LEMONCHIFFON3),
const Standard_Boolean toDisplay = Standard_True);
// creates a finite face based on the given geometric surface
// and displays it in the viewer if toDisplay = Standard_True
Handle(AIS_InteractiveObject) drawCurve (const Handle(Geom_Curve)& theCurve,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_RED),
const Standard_Boolean toDisplay = Standard_True);
// creates an ISession_Curve based on the given geometric curve
// and displays it in the viewer if toDisplay = Standard_True
Handle(AIS_InteractiveObject) drawCurve (const Handle(Geom2d_Curve)& theCurve,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_RED),
const Standard_Boolean toDisplay = Standard_True,
const gp_Ax2& aPosition = gp::XOY());
// converts a given curve to 3d using aPosition and calls the previous method
Handle(AIS_Point) drawPoint (const gp_Pnt& thePnt,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given point
// and displays it in the viewer if toDisplay = Standard_True
Handle(AIS_InteractiveObject) drawVector (const gp_Pnt& thePnt,
const gp_Vec& theVec,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_YELLOW),
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given vector
// and displays it in the viewer if toDisplay = Standard_True
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given shape
// with material PLASTIC and a given color
// and displays it in the viewer if toDisplay = Standard_True
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given shape with the given material
// (color is default for a given material)
// and displays it in the viewer if toDisplay = Standard_True
protected:
// Fields to use in a derivable class
BOOL FitMode;
int myIndex;
int myNbSamples;
private:
COCCDemoDoc* myDoc;
CString myName;
};
#endif // !defined(AFX_OCCDEMO_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,112 +0,0 @@
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "OCCDemo.h"
#include "MainFrm.h"
#include "OCCDemoDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR // status line indicator
};
/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
/* | CBRS_GRIPPER */| CBRS_TOOLTIPS | CBRS_FLYBY) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndToolBar1.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_TOOLTIPS | CBRS_FLYBY) ||
!m_wndToolBar1.LoadToolBar(IDR_TOOLBAR1))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
//m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
//EnableDocking(CBRS_ALIGN_ANY);
//DockControlBar(&m_wndToolBar);
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers

View File

@ -1,59 +0,0 @@
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__57A6A22C_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_MAINFRM_H__57A6A22C_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
CToolBar m_wndToolBar1;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__57A6A22C_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,201 +0,0 @@
// OCCDemo.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "OCCDemo.h"
#include "MainFrm.h"
#include "OCCDemoDoc.h"
#include "OCCDemoView.h"
#include <Standard_Version.hxx>
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COCCDemoApp
BEGIN_MESSAGE_MAP(COCCDemoApp, CWinApp)
//{{AFX_MSG_MAP(COCCDemoApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
//}}AFX_MSG_MAP
// Standard file based document commands
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COCCDemoApp construction
COCCDemoApp::COCCDemoApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
try
{
myGraphicDevice = new Graphic3d_WNTGraphicDevice;
}
catch(Standard_Failure)
{
AfxMessageBox("Fatal Error During Graphic Initialisation");
}
}
/////////////////////////////////////////////////////////////////////////////
// The one and only COCCDemoApp object
COCCDemoApp theApp;
/////////////////////////////////////////////////////////////////////////////
// COCCDemoApp initialization
BOOL COCCDemoApp::InitInstance()
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(COCCDemoDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(COCCDemoView));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// Create result dialog
AfxInitRichEdit();
CMainFrame* cFrame = (CMainFrame*) GetMainWnd();
COCCDemoDoc* aDoc = (COCCDemoDoc*) cFrame->GetActiveDocument();
// pass cFrame->GetDesktopWindow() as parent to have an independent dialog
// pass cFrame as parent to have the result dialog always above the main window
if (!aDoc->GetResultDialog()->Create(CResultDialog::IDD, cFrame->GetDesktopWindow()))
TRACE0("Failed to create result dialog\n");
aDoc->GetResultDialog()->SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), FALSE);
aDoc->GetResultDialog()->ShowWindow(SW_HIDE);
aDoc->GetResultDialog()->Initialize();
// resize the result dialog, so no clipping occures when user
// resizes the dialog manually
// position the result dialog to the left bottom corner of the view
CRect aDlgRect, aViewRect;
aDoc->GetResultDialog()->GetWindowRect(&aDlgRect);
cFrame->GetActiveView()->GetWindowRect(&aViewRect);
int x = aViewRect.left;
int y = aViewRect.bottom - aDlgRect.Size().cy;
int cx = aDlgRect.Size().cx+1;
int cy = aDlgRect.Size().cy+1;
aDoc->GetResultDialog()->SetWindowPos(NULL, x, y, cx, cy, SWP_NOREDRAW | SWP_NOZORDER);
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
m_pMainWnd->SetFocus();
aDoc->Start();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
BOOL OnInitDialog();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BOOL CAboutDlg::OnInitDialog(){
CWnd* TitleWnd = GetDlgItem(IDC_ABOUTBOX_TITLE);
CString TitleString;
TitleWnd->GetWindowText(TitleString);
CString OCC_Version = OCC_VERSION_STRING;
TitleString = TitleString + OCC_Version;
TitleWnd->SetWindowText(TitleString);
CenterWindow();
return TRUE;
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void COCCDemoApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// COCCDemoApp message handlers

View File

@ -1,55 +0,0 @@
// OCCDemo.h : main header file for the OCCDEMO application
//
#if !defined(AFX_OCCDEMO_H__57A6A228_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_OCCDEMO_H__57A6A228_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// COCCDemoApp:
// See OCCDemo.cpp for the implementation of this class
//
class COCCDemoApp : public CWinApp
{
public:
COCCDemoApp();
Handle(Graphic3d_WNTGraphicDevice) GetGraphicDevice() const
{ return myGraphicDevice; } ;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(COCCDemoApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(COCCDemoApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
Handle(Graphic3d_WNTGraphicDevice) myGraphicDevice;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_OCCDEMO_H__57A6A228_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,380 +0,0 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\OCCDemo.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\\OCCDemo.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_OCC_LOGO BITMAP DISCARDABLE "res\\occ_logo.bmp"
IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp"
IDR_TOOLBAR1 BITMAP DISCARDABLE "res\\Toolbar1.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//
IDR_MAINFRAME TOOLBAR DISCARDABLE 20, 20
BEGIN
BUTTON ID_BUTTONStart
BUTTON ID_BUTTONPrev
BUTTON ID_BUTTONRepeat
BUTTON ID_BUTTONNext
BUTTON ID_BUTTONEnd
SEPARATOR
BUTTON ID_BUTTONShowResult
BUTTON ID_DUMP_VIEW
END
IDR_TOOLBAR1 TOOLBAR DISCARDABLE 20, 20
BEGIN
BUTTON ID_BUTTONZoomAll
BUTTON ID_BUTTONZoomWin
BUTTON ID_BUTTONZoomProg
SEPARATOR
BUTTON ID_BUTTONPan
BUTTON ID_BUTTONPanGlo
SEPARATOR
BUTTON ID_BUTTONFront
BUTTON ID_BUTTONTop
BUTTON ID_BUTTONLeft
BUTTON ID_BUTTONBack
BUTTON ID_BUTTONRight
BUTTON ID_BUTTONBottom
BUTTON ID_BUTTONAxo
SEPARATOR
BUTTON ID_BUTTONRot
BUTTON ID_BUTTONReset
SEPARATOR
BUTTON ID_BUTTONWire
BUTTON ID_BUTTONShade
BUTTON ID_BUTTONHlrOn
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "Reset", ID_FILE_NEW
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_APP_EXIT
END
POPUP "&Help"
BEGIN
MENUITEM "&About OCCDemo...", ID_APP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
BEGIN
"A", ID_BUTTONAxo, VIRTKEY, CONTROL, NOINVERT
"B", ID_BUTTONBack, VIRTKEY, CONTROL, NOINVERT
"F", ID_BUTTONZoomAll, VIRTKEY, NOINVERT
"F", ID_BUTTONFront, VIRTKEY, CONTROL, NOINVERT
"H", ID_BUTTONHlrOn, VIRTKEY, SHIFT, NOINVERT
"L", ID_BUTTONLeft, VIRTKEY, CONTROL, NOINVERT
"M", ID_BUTTONBottom, VIRTKEY, CONTROL, NOINVERT
"R", ID_BUTTONReset, VIRTKEY, NOINVERT
"R", ID_BUTTONRight, VIRTKEY, CONTROL, NOINVERT
"S", ID_BUTTONShade, VIRTKEY, SHIFT, NOINVERT
"T", ID_BUTTONTop, VIRTKEY, CONTROL, NOINVERT
VK_END, ID_BUTTONEnd, VIRTKEY, NOINVERT
VK_F11, ID_BUTTONShowResult, VIRTKEY, NOINVERT
VK_F12, ID_DUMP_VIEW, VIRTKEY, NOINVERT
VK_HOME, ID_BUTTONStart, VIRTKEY, NOINVERT
VK_NEXT, ID_BUTTONNext, VIRTKEY, NOINVERT
VK_PRIOR, ID_BUTTONPrev, VIRTKEY, NOINVERT
VK_SPACE, ID_BUTTONRepeat, VIRTKEY, NOINVERT
"W", ID_BUTTONWire, VIRTKEY, SHIFT, NOINVERT
"X", ID_APP_EXIT, VIRTKEY, CONTROL, NOINVERT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOGEX 34, 22, 201, 161
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
CAPTION "About"
FONT 8, "MS Sans Serif"
BEGIN
CTEXT "OCCDemo, Open CASCADE ",IDC_ABOUTBOX_TITLE,3,8,195,8
CTEXT "Copyright (C) 2008, Open CASCADE Company",IDC_STATIC,28,
99,147,8,SS_CENTERIMAGE
DEFPUSHBUTTON "OK",IDOK,55,135,88,14,WS_GROUP
CTEXT "http://www.opencascade.com",IDC_STATIC,50,115,98,8,
SS_CENTERIMAGE
CONTROL 1300,IDC_STATIC,"Static",SS_BITMAP,36,27,129,62,
WS_EX_CLIENTEDGE
END
IDD_ResultDialog DIALOG DISCARDABLE 0, 0, 244, 231
STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME
CAPTION "Result Dialog"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "",IDC_RICHEDIT_ResultDialog,"RICHEDIT",ES_MULTILINE |
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_NOHIDESEL |
ES_READONLY | WS_BORDER | WS_VSCROLL | WS_HSCROLL |
WS_TABSTOP,0,7,243,192
PUSHBUTTON "Copy selection",IDC_CopySelectionToClipboard,0,206,60,
18
PUSHBUTTON "Copy all",IDC_CopyAllToClipboard,65,206,60,18
PUSHBUTTON "Close",IDCANCEL,183,206,60,18
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Open CASCADE Demonstration Application\0"
VALUE "CompanyName", "Open CASCADE, France\0"
VALUE "FileDescription", "OCCDemo MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "OCCDemo\0"
VALUE "LegalCopyright", "Copyright (C) 2001, Open CASCADE Company\0"
VALUE "LegalTrademarks", "Open CASCADE\0"
VALUE "OriginalFilename", "OCCDemo.EXE\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "OCCDemo Application\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ResultDialog, DIALOG
BEGIN
RIGHTMARGIN, 243
TOPMARGIN, 7
BOTTOMMARGIN, 224
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
IDR_MAINFRAME "OCCDemo\n\nOCCDem\n\n\nOCCDemo.Document\nOCCDem Document"
END
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE "OCCDemo"
AFX_IDS_IDLEMESSAGE "Ready"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_NEW "Start demo a new\nReset"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
ID_APP_EXIT "Quit the application\nExit"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCSIZE "Change the window size"
AFX_IDS_SCMOVE "Change the window position"
AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
AFX_IDS_SCCLOSE "Close the active window"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCRESTORE "Restore the window to normal size"
AFX_IDS_SCTASKLIST "Activate Task List"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_BUTTONZoomAll "Press to zoom the application objects in the view\nFitAll (F)"
ID_BUTTONZoomWin "Press and drag MB1 to select a zoom window\nZoom Window"
ID_BUTTONZoomProg "Press and drag MB1 to zoom\nDynamic Zooming"
ID_BUTTONPan "Press and drag MB1 to pan\nDynamic Panning"
ID_BUTTONPanGlo "Press and select a new view center t\nGlobal Panning"
ID_BUTTONFront "Press to select a front View\nFront (Ctrl+F)"
ID_BUTTONLeft "Press to select a left View\nLeft (Ctrl+L)"
ID_BUTTONTop "Press to select a top View\nTop (Ctrl+T)"
ID_BUTTONBack "Press to select a back View\nBack (Ctrl+B)"
ID_BUTTONRight "Press to select a right View\nRight (Ctrl+R)"
ID_BUTTONBottom "Press to select a bottom View\nBottom (Ctrl+M)"
ID_BUTTONAxo "Press to select axonometric View\nAxo (Ctrl+A)"
ID_BUTTONRot "Press and drag MB1 to rotate\nDynamic Rotation"
ID_BUTTONReset "Press to reset view\nReset (R)"
ID_BUTTONWire "Press to switch to wireframe mode\nWireframe mode (Shift+W)"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_BUTTONShade "Press to switch to shading mode\nShading mode (Shift+S)"
ID_BUTTONHlrOn "Press to switch to HLR mode\nHLR mode (Shift+H)"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_BUTTONStart "Press to go to the first sample\nFirst sample (Home)"
ID_BUTTONNext "Press to go to the next sample\nNext sample (PgDn)"
ID_BUTTONShowResult "Press to toggle show of source code on/off\nSource code (F11)"
ID_DUMP_VIEW "Save current frame into a GIF file\nExport view to GIF (F12)"
ID_BUTTONEnd "Press to go to the last sample\nLast sample (End)"
ID_BUTTONPrev "Press to go to the previous sample\nPrevious sample (PgUp)"
ID_BUTTONRepeat "Press to repeat the current sample\nRepeat sample (Space)"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\OCCDemo.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -1,273 +0,0 @@
// OCCDemoDoc.cpp : implementation of the COCCDemoDoc class
//
#include "stdafx.h"
#include "OCCDemo.h"
#include "OCCDemoDoc.h"
#include "OCCDemo_Presentation.h"
#include "OCCDemoView.h"
#include <Standard_ErrorHandler.hxx>
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COCCDemoDoc
IMPLEMENT_DYNCREATE(COCCDemoDoc, CDocument)
BEGIN_MESSAGE_MAP(COCCDemoDoc, CDocument)
//{{AFX_MSG_MAP(COCCDemoDoc)
ON_COMMAND(ID_BUTTONNext, OnBUTTONNext)
ON_COMMAND(ID_BUTTONStart, OnBUTTONStart)
ON_COMMAND(ID_BUTTONRepeat, OnBUTTONRepeat)
ON_COMMAND(ID_BUTTONPrev, OnBUTTONPrev)
ON_COMMAND(ID_BUTTONEnd, OnBUTTONEnd)
ON_UPDATE_COMMAND_UI(ID_BUTTONNext, OnUpdateBUTTONNext)
ON_UPDATE_COMMAND_UI(ID_BUTTONPrev, OnUpdateBUTTONPrev)
ON_COMMAND(ID_FILE_NEW, OnFileNew)
ON_COMMAND(ID_BUTTONShowResult, OnBUTTONShowResult)
ON_UPDATE_COMMAND_UI(ID_BUTTONShowResult, OnUpdateBUTTONShowResult)
ON_COMMAND(ID_DUMP_VIEW, OnDumpView)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COCCDemoDoc construction/destruction
COCCDemoDoc::COCCDemoDoc()
{
// TODO: add one-time construction code here
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
((COCCDemoApp*)AfxGetApp())->GetGraphicDevice();
myViewer = new V3d_Viewer(theGraphicDevice);
myViewer->SetDefaultLights();
myViewer->SetLightOn();
myViewer->SetDefaultBackgroundColor(Quantity_TOC_RGB, 0.,0.,0.);
myAISContext = new AIS_InteractiveContext(myViewer);
myShowResult = FALSE;
myPresentation = OCCDemo_Presentation::Current;
myPresentation->SetDocument(this);
CFile aFile;
if (!aFile.Open("Data\\points.dat", CFile::modeRead)){
strcpy(myDataDir, "..\\Data");
}
else
strcpy(myDataDir, "Data");
strcpy(myLastPath, ".");
}
COCCDemoDoc::~COCCDemoDoc()
{
}
BOOL COCCDemoDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
SetTitle(myPresentation->GetName());
myAISContext->EraseAll(Standard_False);
myAISContext->SetDisplayMode(AIS_Shaded);
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
{
COCCDemoView* pView = (COCCDemoView*) GetNextView(pos);
pView->Reset();
}
return TRUE;
}
void COCCDemoDoc::Start()
{
myPresentation->Init();
OnBUTTONStart();
}
/////////////////////////////////////////////////////////////////////////////
// COCCDemoDoc serialization
void COCCDemoDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{}// TODO: add storing code here
else
{}// TODO: add loading code here
}
/////////////////////////////////////////////////////////////////////////////
// COCCDemoDoc diagnostics
#ifdef _DEBUG
void COCCDemoDoc::AssertValid() const
{
CDocument::AssertValid();
}
void COCCDemoDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// COCCDemoDoc commands
void COCCDemoDoc::OnFileNew()
{
OnNewDocument();
Start();
}
void COCCDemoDoc::InitViewButtons()
{
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
{
COCCDemoView* pView = (COCCDemoView*) GetNextView(pos);
pView->InitButtons();
}
}
void COCCDemoDoc::DoSample()
{
InitViewButtons();
HCURSOR hOldCursor = ::GetCursor();
HCURSOR hNewCursor = AfxGetApp()->LoadStandardCursor(IDC_APPSTARTING);
SetCursor(hNewCursor);
{
try
{
myPresentation->DoSample();
}
catch (Standard_Failure)
{
Standard_SStream ostr;
ostr<<Standard_Failure::Caught()<<"\n\0";
AfxMessageBox (GetSString(ostr));
}
}
SetCursor(hOldCursor);
}
void COCCDemoDoc::OnBUTTONStart()
{
myAISContext->EraseAll(Standard_False);
myPresentation->FirstSample();
DoSample();
}
void COCCDemoDoc::OnBUTTONEnd()
{
myAISContext->EraseAll(Standard_False);
myPresentation->LastSample();
DoSample();
}
void COCCDemoDoc::OnBUTTONRepeat()
{
DoSample();
}
void COCCDemoDoc::OnBUTTONNext()
{
if (!myPresentation->AtLastSample())
{
myPresentation->NextSample();
DoSample();
}
}
void COCCDemoDoc::OnBUTTONPrev()
{
if (!myPresentation->AtFirstSample())
{
myPresentation->PrevSample();
DoSample();
}
}
void COCCDemoDoc::OnUpdateBUTTONNext(CCmdUI* pCmdUI)
{
pCmdUI->Enable (!myPresentation->AtLastSample());
}
void COCCDemoDoc::OnUpdateBUTTONPrev(CCmdUI* pCmdUI)
{
pCmdUI->Enable (!myPresentation->AtFirstSample());
}
void COCCDemoDoc::OnBUTTONShowResult()
{
myShowResult = !myShowResult;
if (myShowResult)
myCResultDialog.ShowWindow(SW_SHOWNORMAL);
else
myCResultDialog.ShowWindow(SW_HIDE);
}
void COCCDemoDoc::OnUpdateBUTTONShowResult(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myShowResult);
}
void COCCDemoDoc::OnDumpView()
{
// save current directory and restore it on exit
char aCurPath[MAX_PATH];
::GetCurrentDirectory(MAX_PATH, aCurPath);
::SetCurrentDirectory(myLastPath);
CFileDialog *aDlg = new CFileDialog(false, "gif", "OCCView.gif",
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "GIF Files (*.gif)|*.gif||", NULL);
int result = aDlg->DoModal();
if ( result == IDOK)
{
CString aFileName = aDlg->GetFileName();
delete aDlg;
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
{
COCCDemoView* pView = (COCCDemoView*) GetNextView(pos);
pView->UpdateWindow();
}
myViewer->InitActiveViews();
Handle(V3d_View) aView = myViewer->ActiveView();
char aStrFileName[MAX_PATH];
strcpy(aStrFileName, aFileName);
aView->Dump(aStrFileName);
}
else
delete aDlg;
::GetCurrentDirectory(MAX_PATH, myLastPath);
::SetCurrentDirectory(aCurPath);
}
void COCCDemoDoc::Fit()
{
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
pView->FitAll();
}

View File

@ -1,88 +0,0 @@
// OCCDemoDoc.h : interface of the COCCDemoDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_OCCDEMODOC_H__57A6A22E_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_OCCDEMODOC_H__57A6A22E_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ResultDialog.h"
class OCCDemo_Presentation;
class COCCDemoDoc : public CDocument
{
public:
Handle(V3d_Viewer) GetViewer() const { return myViewer; };
Handle(AIS_InteractiveContext) GetAISContext() const { return myAISContext; };
CResultDialog* GetResultDialog () {return &myCResultDialog;}
Standard_CString GetDataDir() {return myDataDir;}
protected: // create from serialization only
COCCDemoDoc();
DECLARE_DYNCREATE(COCCDemoDoc)
// Attributes
public:
BOOL& IsShowResult() {return myShowResult;}
// Operations
public:
void Start();
static void Fit();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(COCCDemoDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~COCCDemoDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
void InitViewButtons();
void DoSample();
// Generated message map functions
protected:
//{{AFX_MSG(COCCDemoDoc)
afx_msg void OnBUTTONNext();
afx_msg void OnBUTTONStart();
afx_msg void OnBUTTONRepeat();
afx_msg void OnBUTTONPrev();
afx_msg void OnBUTTONEnd();
afx_msg void OnUpdateBUTTONNext(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONPrev(CCmdUI* pCmdUI);
afx_msg void OnFileNew();
afx_msg void OnBUTTONShowResult();
afx_msg void OnUpdateBUTTONShowResult(CCmdUI* pCmdUI);
afx_msg void OnDumpView();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
Handle(V3d_Viewer) myViewer;
Handle(AIS_InteractiveContext) myAISContext;
OCCDemo_Presentation *myPresentation;
CResultDialog myCResultDialog;
BOOL myShowResult;
char myDataDir[8]; // for "..\Data\0"
char myLastPath[MAX_PATH]; // directory of lastly saved file in DumpView()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_OCCDEMODOC_H__57A6A22E_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,583 +0,0 @@
// OCCDemoView.cpp : implementation of the COCCDemoView class
//
#include "stdafx.h"
#include "MainFrm.h"
#include "OCCDemo.h"
#include "OCCDemoDoc.h"
#include "OCCDemoView.h"
#include <Graphic3d_GraphicDriver.hxx>
#define ValZWMin 1
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COCCDemoView
IMPLEMENT_DYNCREATE(COCCDemoView, CView)
BEGIN_MESSAGE_MAP(COCCDemoView, CView)
//{{AFX_MSG_MAP(COCCDemoView)
ON_COMMAND(ID_BUTTONAxo, OnBUTTONAxo)
ON_COMMAND(ID_BUTTONBack, OnBUTTONBack)
ON_COMMAND(ID_BUTTONBottom, OnBUTTONBottom)
ON_COMMAND(ID_BUTTONFront, OnBUTTONFront)
ON_COMMAND(ID_BUTTONHlrOn, OnBUTTONHlrOn)
ON_COMMAND(ID_BUTTONLeft, OnBUTTONLeft)
ON_COMMAND(ID_BUTTONPan, OnBUTTONPan)
ON_COMMAND(ID_BUTTONPanGlo, OnBUTTONPanGlo)
ON_COMMAND(ID_BUTTONReset, OnBUTTONReset)
ON_COMMAND(ID_BUTTONRight, OnBUTTONRight)
ON_COMMAND(ID_BUTTONRot, OnBUTTONRot)
ON_COMMAND(ID_BUTTONTop, OnBUTTONTop)
ON_COMMAND(ID_BUTTONZoomAll, OnBUTTONZoomAll)
ON_WM_SIZE()
ON_COMMAND(ID_BUTTONZoomProg, OnBUTTONZoomProg)
ON_COMMAND(ID_BUTTONZoomWin, OnBUTTONZoomWin)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MOUSEMOVE()
ON_WM_RBUTTONDOWN()
ON_WM_RBUTTONUP()
ON_UPDATE_COMMAND_UI(ID_BUTTONPanGlo, OnUpdateBUTTONPanGlo)
ON_UPDATE_COMMAND_UI(ID_BUTTONPan, OnUpdateBUTTONPan)
ON_UPDATE_COMMAND_UI(ID_BUTTONZoomProg, OnUpdateBUTTONZoomProg)
ON_UPDATE_COMMAND_UI(ID_BUTTONZoomWin, OnUpdateBUTTONZoomWin)
ON_UPDATE_COMMAND_UI(ID_BUTTONRot, OnUpdateBUTTONRot)
ON_COMMAND(ID_BUTTONWire, OnBUTTONWire)
ON_COMMAND(ID_BUTTONShade, OnBUTTONShade)
ON_UPDATE_COMMAND_UI(ID_BUTTONHlrOn, OnUpdateBUTTONHlrOn)
ON_UPDATE_COMMAND_UI(ID_BUTTONShade, OnUpdateBUTTONShade)
ON_UPDATE_COMMAND_UI(ID_BUTTONWire, OnUpdateBUTTONWire)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COCCDemoView construction/destruction
COCCDemoView::COCCDemoView()
{
myXmin=0;
myYmin=0;
myXmax=0;
myYmax=0;
myCurZoom=0;
myCurrentMode = CurAction3d_Nothing;
myVisMode = VIS_SHADE;
m_Pen = NULL;
myGraphicDriver = Handle(Graphic3d_GraphicDriver)::DownCast(
((COCCDemoApp*)AfxGetApp())->GetGraphicDevice()->GraphicDriver() );
}
COCCDemoView::~COCCDemoView()
{
if (!myView.IsNull())
myView->Remove();
if (m_Pen)
delete m_Pen;
}
BOOL COCCDemoView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// COCCDemoView drawing
void COCCDemoView::OnInitialUpdate()
{
CView::OnInitialUpdate();
myView = GetDocument()->GetViewer()->CreateView();
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
((COCCDemoApp*)AfxGetApp())->GetGraphicDevice();
Handle(WNT_Window) aWNTWindow = new WNT_Window(theGraphicDevice,GetSafeHwnd ());
myView->SetWindow(aWNTWindow);
if (!aWNTWindow->IsMapped()) aWNTWindow->Map();
myCurrentMode = CurAction3d_Nothing;
myVisMode = VIS_SHADE;
RedrawVisMode();
}
void COCCDemoView::OnDraw(CDC* pDC)
{
COCCDemoDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
myView->Redraw();
}
/////////////////////////////////////////////////////////////////////////////
// COCCDemoView diagnostics
#ifdef _DEBUG
void COCCDemoView::AssertValid() const
{
CView::AssertValid();
}
void COCCDemoView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
COCCDemoDoc* COCCDemoView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(COCCDemoDoc)));
return (COCCDemoDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// COCCDemoView message handlers
void COCCDemoView::OnSize(UINT nType, int cx, int cy)
{
if (!myView.IsNull())
myView->MustBeResized();
}
void COCCDemoView::OnBUTTONBack()
{
myView->SetProj(V3d_Ypos);
}
void COCCDemoView::OnBUTTONFront()
{
myView->SetProj(V3d_Yneg);
}
void COCCDemoView::OnBUTTONBottom()
{
myView->SetProj(V3d_Zneg);
}
void COCCDemoView::OnBUTTONTop()
{
myView->SetProj(V3d_Zpos);
}
void COCCDemoView::OnBUTTONLeft()
{
myView->SetProj(V3d_Xneg);
}
void COCCDemoView::OnBUTTONRight()
{
myView->SetProj(V3d_Xpos);
}
void COCCDemoView::OnBUTTONAxo()
{
myView->SetProj(V3d_XposYnegZpos);
}
void COCCDemoView::OnBUTTONPan()
{
myCurrentMode = CurAction3d_DynamicPanning;
}
void COCCDemoView::OnBUTTONPanGlo()
{
// save the current zoom value
myCurZoom = myView->Scale();
// Do a Global Zoom
myView->FitAll();
// Set the mode
myCurrentMode = CurAction3d_GlobalPanning;
}
void COCCDemoView::OnBUTTONReset()
{
myView->Reset();
}
void COCCDemoView::OnBUTTONRot()
{
myCurrentMode = CurAction3d_DynamicRotation;
}
void COCCDemoView::OnBUTTONZoomAll()
{
myView->FitAll();
myView->ZFitAll();
}
void COCCDemoView::OnBUTTONZoomProg()
{
myCurrentMode = CurAction3d_DynamicZooming;
}
void COCCDemoView::OnBUTTONZoomWin()
{
myCurrentMode = CurAction3d_WindowZooming;
}
void COCCDemoView::OnLButtonDown(UINT nFlags, CPoint point)
{
// save the current mouse coordinate in min
myXmin=point.x; myYmin=point.y;
myXmax=point.x; myYmax=point.y;
if ( ! (nFlags & MK_CONTROL) )
{
if (myCurrentMode == CurAction3d_DynamicRotation)
{
myView->SetComputedMode(Standard_False);
myView->StartRotation(point.x,point.y);
}
}
}
void COCCDemoView::OnLButtonUp(UINT nFlags, CPoint point)
{
if ( !(nFlags & MK_CONTROL) )
{
switch (myCurrentMode)
{
case CurAction3d_Nothing :
myXmax=point.x;
myYmax=point.y;
break;
case CurAction3d_DynamicZooming :
myCurrentMode = CurAction3d_Nothing;
break;
case CurAction3d_WindowZooming :
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False);
myXmax=point.x;
myYmax=point.y;
if ((abs(myXmin-myXmax)>ValZWMin) || (abs(myYmin-myYmax)>ValZWMin))
// Test if the zoom window is greater than a minimale window.
{
// Do the zoom window between Pmin and Pmax
myView->WindowFitAll(myXmin,myYmin,myXmax,myYmax);
}
myCurrentMode = CurAction3d_Nothing;
break;
case CurAction3d_DynamicPanning :
myCurrentMode = CurAction3d_Nothing;
break;
case CurAction3d_GlobalPanning :
myView->Place(point.x,point.y,myCurZoom);
myCurrentMode = CurAction3d_Nothing;
break;
case CurAction3d_DynamicRotation :
if (myVisMode == VIS_HLR)
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myView->SetComputedMode(Standard_True);
myView->Redraw();
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
myCurrentMode = CurAction3d_Nothing;
break;
} //switch (myCurrentMode)
}
}
void COCCDemoView::OnRButtonDown(UINT nFlags, CPoint point)
{
if ( nFlags & MK_CONTROL )
{
myView->SetComputedMode(Standard_False);
myView->StartRotation(point.x,point.y);
}
}
void COCCDemoView::OnRButtonUp(UINT nFlags, CPoint point)
{
if (myVisMode == VIS_HLR)
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myView->SetComputedMode(Standard_True);
myView->Redraw();
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
}
void COCCDemoView::OnMouseMove(UINT nFlags, CPoint point)
{
// ============================ LEFT BUTTON =======================
if ( nFlags & MK_LBUTTON)
{
if ( nFlags & MK_CONTROL )
{
// move with MB1 and Control : on the dynamic zooming
// Do the zoom in function of mouse's coordinates
myView->Zoom(myXmax,myYmax,point.x,point.y);
// save the current mouse coordinate in max
myXmax = point.x;
myYmax = point.y;
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction3d_Nothing :
myXmax = point.x;
myYmax = point.y;
break;
case CurAction3d_DynamicZooming :
myView->Zoom(myXmax,myYmax,point.x,point.y);
// save the current mouse coordinate in max;
myXmax=point.x;
myYmax=point.y;
break;
case CurAction3d_WindowZooming :
myXmax = point.x; myYmax = point.y;
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash);
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_True,LongDash);
break;
case CurAction3d_DynamicPanning :
myView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
myXmax = point.x; myYmax = point.y;
break;
case CurAction3d_GlobalPanning : // nothing
break;
case CurAction3d_DynamicRotation :
myView->Rotation(point.x,point.y);
myView->Redraw();
break;
}
}
}
// ============================ MIDDLE BUTTON =======================
else if ( nFlags & MK_MBUTTON)
{
if ( nFlags & MK_CONTROL )
{
myView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
myXmax = point.x; myYmax = point.y;
}
}
// ============================ RIGHT BUTTON =======================
else if ( nFlags & MK_RBUTTON)
{
if ( nFlags & MK_CONTROL )
{
myView->Rotation(point.x,point.y);
}
}
// ============================ NO BUTTON =======================
else
{
myXmax = point.x;
myYmax = point.y;
}
}
void COCCDemoView::OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myCurrentMode == CurAction3d_GlobalPanning);
pCmdUI->Enable (myCurrentMode != CurAction3d_GlobalPanning);
}
void COCCDemoView::OnUpdateBUTTONPan(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myCurrentMode == CurAction3d_DynamicPanning);
pCmdUI->Enable (myCurrentMode != CurAction3d_DynamicPanning );
}
void COCCDemoView::OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myCurrentMode == CurAction3d_DynamicZooming );
pCmdUI->Enable (myCurrentMode != CurAction3d_DynamicZooming);
}
void COCCDemoView::OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myCurrentMode == CurAction3d_WindowZooming);
pCmdUI->Enable (myCurrentMode != CurAction3d_WindowZooming);
}
void COCCDemoView::OnUpdateBUTTONRot(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myCurrentMode == CurAction3d_DynamicRotation);
pCmdUI->Enable (myCurrentMode != CurAction3d_DynamicRotation);
}
void COCCDemoView::DrawRectangle(const Standard_Integer MinX,
const Standard_Integer MinY,
const Standard_Integer MaxX,
const Standard_Integer MaxY,
const Standard_Boolean Draw,
const LineStyle aLineStyle)
{
static int m_DrawMode;
if (!m_Pen && aLineStyle ==Solid )
{
m_Pen = new CPen(PS_SOLID, 1, RGB(0,0,0)); m_DrawMode = R2_MERGEPENNOT;
}
else if (!m_Pen && aLineStyle ==Dot )
{
m_Pen = new CPen(PS_DOT, 1, RGB(0,0,0)); m_DrawMode = R2_XORPEN;
}
else if (!m_Pen && aLineStyle == ShortDash)
{
m_Pen = new CPen(PS_DASH, 1, RGB(255,0,0)); m_DrawMode = R2_XORPEN;
}
else if (!m_Pen && aLineStyle == LongDash)
{
m_Pen = new CPen(PS_DASH, 1, RGB(0,0,0)); m_DrawMode = R2_NOTXORPEN;
}
else if (aLineStyle == Default)
{
m_Pen = NULL; m_DrawMode = R2_MERGEPENNOT;
}
CPen* aOldPen;
CClientDC clientDC(this);
if (m_Pen)
aOldPen = clientDC.SelectObject(m_Pen);
clientDC.SetROP2(m_DrawMode);
static Standard_Integer StoredMinX, StoredMaxX, StoredMinY, StoredMaxY;
static Standard_Boolean m_IsVisible = Standard_False;
if ( m_IsVisible && !Draw) // move or up : erase at the old position
{
clientDC.MoveTo(StoredMinX,StoredMinY); clientDC.LineTo(StoredMinX,StoredMaxY);
clientDC.LineTo(StoredMaxX,StoredMaxY);
clientDC.LineTo(StoredMaxX,StoredMinY); clientDC.LineTo(StoredMinX,StoredMinY);
m_IsVisible = false;
}
StoredMinX = min ( MinX, MaxX );
StoredMinY = min ( MinY, MaxY );
StoredMaxX = max ( MinX, MaxX );
StoredMaxY = max ( MinY, MaxY);
if (Draw) // move : draw
{
clientDC.MoveTo(StoredMinX,StoredMinY); clientDC.LineTo(StoredMinX,StoredMaxY);
clientDC.LineTo(StoredMaxX,StoredMaxY);
clientDC.LineTo(StoredMaxX,StoredMinY); clientDC.LineTo(StoredMinX,StoredMinY);
m_IsVisible = true;
}
if (m_Pen)
clientDC.SelectObject(aOldPen);
}
void COCCDemoView::InitButtons()
{
myXmin=0;
myYmin=0;
myXmax=0;
myYmax=0;
myCurZoom=0;
myCurrentMode = CurAction3d_Nothing;
}
void COCCDemoView::Reset()
{
InitButtons();
myVisMode = VIS_SHADE;
if (!myView.IsNull())
{
RedrawVisMode();
myView->Reset();
}
}
void COCCDemoView::RedrawVisMode()
{
switch (myVisMode)
{
case VIS_WIREFRAME:
GetDocument()->GetAISContext()->SetDisplayMode(AIS_WireFrame);
myView->SetComputedMode (Standard_False);
myView->Redraw();
break;
case VIS_SHADE:
GetDocument()->GetAISContext()->SetDisplayMode(AIS_Shaded);
myView->SetComputedMode (Standard_False);
myView->Redraw();
break;
case VIS_HLR:
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myView->SetComputedMode (Standard_True);
myView->Redraw();
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
GetDocument()->GetAISContext()->SetDisplayMode(AIS_WireFrame);
break;
}
}
void COCCDemoView::OnBUTTONWire()
{
myVisMode = VIS_WIREFRAME;
RedrawVisMode();
}
void COCCDemoView::OnBUTTONShade()
{
myVisMode = VIS_SHADE;
RedrawVisMode();
}
void COCCDemoView::OnBUTTONHlrOn()
{
myVisMode = VIS_HLR;
RedrawVisMode();
}
void COCCDemoView::OnUpdateBUTTONWire(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myVisMode == VIS_WIREFRAME);
pCmdUI->Enable (myVisMode != VIS_WIREFRAME);
}
void COCCDemoView::OnUpdateBUTTONShade(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myVisMode == VIS_SHADE);
pCmdUI->Enable (myVisMode != VIS_SHADE);
}
void COCCDemoView::OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myVisMode == VIS_HLR);
pCmdUI->Enable (myVisMode != VIS_HLR);
}
void COCCDemoView::GetViewCenter(Standard_Real& Xc, Standard_Real& Yc)
{
myView->Center(Xc,Yc);
}
void COCCDemoView::SetViewCenter(Standard_Real Xc, Standard_Real Yc)
{
myView->SetCenter(Xc,Yc);
}
void COCCDemoView::GetViewEye(Standard_Real& X, Standard_Real& Y, Standard_Real& Z)
{
myView->Eye(X,Y,Z);
}
void COCCDemoView::SetViewEye(Standard_Real X, Standard_Real Y, Standard_Real Z)
{
myView->SetEye(X,Y,Z);
}
Standard_Real COCCDemoView::GetViewScale()
{
return myView->Scale();
}
void COCCDemoView::SetViewScale(Standard_Real Coef)
{
myView->SetScale(Coef);
}

View File

@ -1,138 +0,0 @@
// OCCDemoView.h : interface of the COCCDemoView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_OCCDEMOVIEW_H__57A6A230_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_OCCDEMOVIEW_H__57A6A230_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
enum View3D_CurrentAction {
CurAction3d_Nothing,
CurAction3d_DynamicZooming,
CurAction3d_WindowZooming,
CurAction3d_DynamicPanning,
CurAction3d_GlobalPanning,
CurAction3d_DynamicRotation
};
class COCCDemoView : public CView
{
protected: // create from serialization only
COCCDemoView();
DECLARE_DYNCREATE(COCCDemoView)
// Attributes
public:
COCCDemoDoc* GetDocument();
// Operations
public:
void InitButtons();
void Reset();
void FitAll() { myView->FitAll(); myView->ZFitAll(); };
void GetViewCenter(Standard_Real& Xc, Standard_Real& Yc);
void SetViewCenter(const Standard_Real Xc, const Standard_Real Yc);
void GetViewEye(Standard_Real& X, Standard_Real& Y, Standard_Real& Z);
void SetViewEye(const Standard_Real X,const Standard_Real Y,const Standard_Real Z);
Standard_Real GetViewScale();
void SetViewScale(const Standard_Real Coef);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(COCCDemoView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnInitialUpdate();
protected:
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~COCCDemoView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(COCCDemoView)
afx_msg void OnBUTTONAxo();
afx_msg void OnBUTTONBack();
afx_msg void OnBUTTONBottom();
afx_msg void OnBUTTONFront();
afx_msg void OnBUTTONHlrOn();
afx_msg void OnBUTTONLeft();
afx_msg void OnBUTTONPan();
afx_msg void OnBUTTONPanGlo();
afx_msg void OnBUTTONReset();
afx_msg void OnBUTTONRight();
afx_msg void OnBUTTONRot();
afx_msg void OnBUTTONTop();
afx_msg void OnBUTTONZoomAll();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnBUTTONZoomProg();
afx_msg void OnBUTTONZoomWin();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONPan(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONRot(CCmdUI* pCmdUI);
afx_msg void OnBUTTONWire();
afx_msg void OnBUTTONShade();
afx_msg void OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONShade(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONWire(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
void RedrawVisMode();
private:
enum VisMode { VIS_WIREFRAME, VIS_SHADE, VIS_HLR };
Handle(V3d_View) myView;
Handle(Graphic3d_GraphicDriver) myGraphicDriver;
View3D_CurrentAction myCurrentMode;
VisMode myVisMode;
Standard_Integer myXmin;
Standard_Integer myYmin;
Standard_Integer myXmax;
Standard_Integer myYmax;
Standard_Real myCurZoom;
private:
enum LineStyle { Solid, Dot, ShortDash, LongDash, Default };
CPen* m_Pen;
virtual void DrawRectangle (const Standard_Integer MinX ,
const Standard_Integer MinY ,
const Standard_Integer MaxX ,
const Standard_Integer MaxY ,
const Standard_Boolean Draw ,
const LineStyle aLineStyle = Default );
};
#ifndef _DEBUG // debug version in OCCDemoView.cpp
inline COCCDemoDoc* COCCDemoView::GetDocument()
{ return (COCCDemoDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_OCCDEMOVIEW_H__57A6A230_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,206 +0,0 @@
// ResultDialog.cpp : implementation file
//
#include "stdafx.h"
#include "OCCDemo.h"
#include "ResultDialog.h"
#include "MainFrm.h"
#include "OCCDemoDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// minimum distance between buttons, button and dialog border
#define d 5
/////////////////////////////////////////////////////////////////////////////
// CResultDialog dialog
CResultDialog::CResultDialog(CWnd* pParent /*=NULL*/)
: CDialog(CResultDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CResultDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CResultDialog::Empty()
{
CRichEditCtrl *pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
pEd->Clear();
}
void CResultDialog::SetText(LPCSTR aText)
{
CRichEditCtrl *pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
CString aCStr(aText);
pEd->SetWindowText(aCStr);
}
void CResultDialog::SetTitle(LPCSTR aTitle)
{
CString aCStr(aTitle);
SetWindowText(aCStr);
}
void CResultDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CResultDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CResultDialog, CDialog)
//{{AFX_MSG_MAP(CResultDialog)
ON_BN_CLICKED(IDC_CopySelectionToClipboard, OnCopySelectionToClipboard)
ON_BN_CLICKED(IDC_CopyAllToClipboard, OnCopyAllToClipboard)
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResultDialog message handlers
void CResultDialog::OnCopySelectionToClipboard()
{
CRichEditCtrl *pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
pEd->Copy( );
}
void CResultDialog::OnCopyAllToClipboard()
{
CRichEditCtrl *pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
long nStartChar, nEndChar;
pEd->GetSel (nStartChar, nEndChar);
pEd->SetSel (0, -1);
pEd->Copy();
pEd->SetSel (nStartChar, nEndChar);
}
void CResultDialog::OnCancel()
{
CMainFrame* cFrame = (CMainFrame*) AfxGetApp()->GetMainWnd();
COCCDemoDoc* aDoc = (COCCDemoDoc*) cFrame->GetActiveDocument();
aDoc->IsShowResult() = FALSE;
CDialog::OnCancel();
}
void CResultDialog::Initialize()
{
// Set Fixed Width Font for rich edit control
CRichEditCtrl *pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
CFont aFixedWidthFont;
VERIFY(aFixedWidthFont.CreateFont(
15, // nHeight
5, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
FF_MODERN, // Fix width fonts are FF_MODERN
"Courier New")); // lpszFacename
pEd->SetFont(&aFixedWidthFont, false);
// save button's width and height, so they are calculated only once
RECT rect;
CWnd *pBCopy = (CWnd *) GetDlgItem (IDC_CopySelectionToClipboard);
pBCopy->GetWindowRect(&rect);
bw = rect.right - rect.left; // a button's width (they are all equal)
bh = rect.bottom - rect.top; // a button's height
}
// OnSize is a message handler of WM_SIZE messge,
// it is reimplemented in order to reposition the buttons
// (keep them always in the bottom part of the dialog)
// and resize the rich edit controls as user resized THIS dialog.
void CResultDialog::OnSize(UINT nType, int cx, int cy)
{
// call the base class handler
CDialog::OnSize(nType, cx, cy);
//resizes internal GUI controls (rich edit control and 3 buttons)
//according to given values of this dialog width (cx) and height (cy).
//the method is called from OnSize message handler and
//from InitInstance of OCCDemo to do initial resize
CWnd *pEd = (CWnd *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
CWnd *pBCopy = (CWnd *) GetDlgItem (IDC_CopySelectionToClipboard);
CWnd *pBCopyAll = (CWnd *) GetDlgItem (IDC_CopyAllToClipboard);
CWnd *pBClose = (CWnd *) GetDlgItem (IDCANCEL);
if (pEd != NULL) // it is NULL when dialog is being created and OnSize is called
{
int butY = cy-bh-d; // y coordinate of buttons' top left corner
pEd->SetWindowPos(&wndTop, 0, 0, cx, butY-4*d, SWP_NOMOVE);
pBCopy->SetWindowPos(&wndTop, d, butY, 0, 0, SWP_NOSIZE);
pBCopyAll->SetWindowPos(&wndTop, d+bw+d, butY, 0, 0, SWP_NOSIZE);
pBClose->SetWindowPos(&wndTop, cx-bw-d, butY, 0, 0, SWP_NOSIZE);
}
RedrawWindow();
}
LRESULT CResultDialog::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if (message != WM_SIZING)
return CDialog::WindowProc(message, wParam, lParam);
LPRECT pRect = (LPRECT) lParam;
int cx = pRect->right - pRect->left;
int cy = pRect->bottom - pRect->top;
int minCx = 3*bw+5*d;
int minCy = 2*d+bh+200;
if (cx < minCx || cy < minCy)
{
switch (wParam)
{
case WMSZ_BOTTOM:
pRect->bottom = pRect->top + minCy;
break;
case WMSZ_TOP:
pRect->top = pRect->bottom - minCy;
break;
case WMSZ_LEFT:
pRect->left = pRect->right - minCx;
break;
case WMSZ_RIGHT:
pRect->right = pRect->left + minCx;
break;
case WMSZ_TOPLEFT:
if (cx < minCx) pRect->left = pRect->right - minCx;
if (cy < minCy) pRect->top = pRect->bottom - minCy;
break;
case WMSZ_BOTTOMRIGHT:
if (cx < minCx) pRect->right = pRect->left + minCx;
if (cy < minCy) pRect->bottom = pRect->top + minCy;
break;
case WMSZ_TOPRIGHT:
if (cx < minCx) pRect->right = pRect->left + minCx;
if (cy < minCy) pRect->top = pRect->bottom - minCy;
break;
case WMSZ_BOTTOMLEFT:
if (cx < minCx) pRect->left = pRect->right - minCx;
if (cy < minCy) pRect->bottom = pRect->top + minCy;
break;
}
}
return CDialog::WindowProc(message, wParam, lParam);
}

View File

@ -1,66 +0,0 @@
#if !defined(AFX_RESULTDIALOG_H__6597303D_7F5B_11D5_BA4D_0060B0EE18EA__INCLUDED_)
#define AFX_RESULTDIALOG_H__6597303D_7F5B_11D5_BA4D_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ResultDialog.h : header file
//
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
// CResultDialog dialog
class CResultDialog : public CDialog
{
// Construction
public:
void Initialize();
CResultDialog(CWnd* pParent = NULL); // standard constructor
void SetTitle(LPCSTR aTitle);
void SetText(LPCSTR aText);
void Empty();
// Dialog Data
//{{AFX_DATA(CResultDialog)
enum { IDD = IDD_ResultDialog };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CResultDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CResultDialog)
afx_msg void OnCopySelectionToClipboard();
afx_msg void OnCopyAllToClipboard();
virtual void OnCancel();
// OnSize is a message handler of WM_SIZE messge,
// it is reimplemented in order to reposition the buttons
// (keep them always in the bottom part of the dialog)
// and resize the rich edit controls as user resized THIS dialog.
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
int bw, bh; // button width and height
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RESULTDIALOG_H__6597303D_7F5B_11D5_BA4D_0060B0EE18EA__INCLUDED_)

View File

@ -1,6 +0,0 @@
// stdafx.cpp : source file that includes just the standard includes
// OCCDemo.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

View File

@ -1,44 +0,0 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__57A6A22A_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_STDAFX_H__57A6A22A_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
//#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#if !defined(WNT)
#error WNT precompiler directive is mandatory for CasCade
#endif
#pragma warning( disable : 4244 ) // Issue warning 4244
#include "Standard_ShortReal.hxx"
#pragma warning( default : 4244 ) // Issue warning 4244
#include <Standard.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_Shape.hxx>
#include <AIS_Point.hxx>
#include <Graphic3d_WNTGraphicDevice.hxx>
#include <V3d_Viewer.hxx>
#include <V3d_View.hxx>
#include <WNT_Window.hxx>
#include <Standard_ErrorHandler.hxx>
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__57A6A22A_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -1 +0,0 @@
// This file is to be included in the main resource file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -1,49 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by OCCDemo.rc
//
#define IDR_MAINFRAME 128
#define IDR_TOOLBAR1 130
#define IDD_ResultDialog 133
#define IDC_CopySelectionToClipboard 1000
#define IDC_CopyAllToClipboard 1001
#define IDC_RICHEDIT_ResultDialog 1005
#define IDB_OCC_LOGO 1300
#define IDD_ABOUTBOX 10000
#define IDC_ABOUTBOX_TITLE 10001
#define ID_BUTTONZoomAll 40000
#define ID_BUTTONZoomWin 40002
#define ID_BUTTONZoomProg 40003
#define ID_BUTTONPan 40004
#define ID_BUTTONPanGlo 40005
#define ID_BUTTONFront 40006
#define ID_BUTTONLeft 40007
#define ID_BUTTONTop 40008
#define ID_BUTTONBack 40009
#define ID_BUTTONRight 40010
#define ID_BUTTONBottom 40011
#define ID_BUTTONAxo 40012
#define ID_BUTTONRot 40013
#define ID_BUTTONReset 40014
#define ID_BUTTONWire 40015
#define ID_BUTTONShade 40016
#define ID_BUTTONHlrOn 40017
#define ID_BUTTONStart 40103
#define ID_BUTTONNext 40104
#define ID_BUTTONShowResult 40105
#define ID_DUMP_VIEW 40106
#define ID_BUTTONEnd 40107
#define ID_BUTTONPrev 40109
#define ID_BUTTONRepeat 40110
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 136
#define _APS_NEXT_COMMAND_VALUE 40111
#define _APS_NEXT_CONTROL_VALUE 1007
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -1,428 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Convert"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/Convert.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Release/Convert.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/Convert.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/Convert.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/Convert.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Debug/Convert.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/Convert.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/Convert.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="Convert_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="Convert_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,461 +0,0 @@
// Convert_Presentation.cpp: implementation of the Convert_Presentation class.
// Conversion of elementary geometry to BSpline curves and surfaces
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Convert_Presentation.h"
#include <Quantity_Color.hxx>
#include <gp_Dir.hxx>
#include <gp_Ax2.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <GeomConvert.hxx>
#include <Geom_BezierSurface.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_SphericalSurface.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_ToroidalSurface.hxx>
#include <Geom_ConicalSurface.hxx>
// Initialization of global variable with an instance of this class
OCCDemo_Presentation* OCCDemo_Presentation::Current = new Convert_Presentation;
// Initialization of array of samples
const Convert_Presentation::PSampleFuncType Convert_Presentation::SampleFuncs[] =
{
&Convert_Presentation::sampleCircle,
&Convert_Presentation::sampleEllipse,
&Convert_Presentation::sampleBezier,
&Convert_Presentation::sampleBezierSurface,
&Convert_Presentation::sampleCylindricalSurface,
&Convert_Presentation::sampleRevolSurface,
&Convert_Presentation::sampleToroidalSurface,
&Convert_Presentation::sampleConicalSurface,
&Convert_Presentation::sampleSphericalSurface
};
// Colors of objects
static const Quantity_Color CurveColor (1,1,0, Quantity_TOC_RGB); // yellow
static const Quantity_Color SurfaceColor (1,1,0, Quantity_TOC_RGB); // yellow
static const Quantity_Color BSplineColor (1,0.647,0, Quantity_TOC_RGB); // orange
static const Quantity_Color BSplineSurfaceColor (0,0,1, Quantity_TOC_RGB); // blue
#ifdef WNT
#define EOL "\r\n"
#else
#define EOL "\n"
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Convert_Presentation::Convert_Presentation()
{
FitMode = true;
setName ("Conversion to BSpline curves and surfaces");
myIndex = 0;
myNbFuncs = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
myNbSamples = myNbFuncs;
}
//////////////////////////////////////////////////////////////////////
// Sample execution
//////////////////////////////////////////////////////////////////////
void Convert_Presentation::DoSample()
{
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbFuncs)
(this->*SampleFuncs[myIndex])();
}
//================================================================
// Function : Convert_Presentation::drawSurfaceAndItsBSpline
// Purpose :
//================================================================
void Convert_Presentation::drawSurfaceAndItsBSpline(Handle(Geom_Surface) theSurface,
const Standard_CString theName,
TCollection_AsciiString& theText)
{
TCollection_AsciiString aTitle ("Converting ");
aTitle += theName;
aTitle += " to BSpline surface";
theText += EOL
" Handle(Geom_BSplineSurface) aBSplineSurface = " EOL
" GeomConvert::SurfaceToBSplineSurface(aSurface);" EOL;
setResultTitle (aTitle.ToCString());
setResultText (theText.ToCString());
drawSurface (theSurface, SurfaceColor);
if (WAIT_A_LITTLE) return;
Handle(Geom_BSplineSurface) aBSplineSurface = GeomConvert::SurfaceToBSplineSurface(theSurface);
_ASSERTE(!aBSplineSurface.IsNull());
drawSurface (aBSplineSurface, BSplineSurfaceColor);
}
//================================================================
// Function : Convert_Presentation::drawCurveAndItsBSpline
// Purpose :
//================================================================
void Convert_Presentation::drawCurveAndItsBSpline(Handle(Geom_Curve) theCurve,
const Standard_CString theName,
TCollection_AsciiString& theText)
{
TCollection_AsciiString aTitle ("Converting ");
aTitle += theName;
aTitle += " to BSpline curve";
theText += EOL
" Handle(Geom_BSplineCurve) aBSpline = " EOL
" GeomConvert::CurveToBSplineCurve(aCurve);" EOL;
setResultTitle (aTitle.ToCString());
setResultText (theText.ToCString());
drawCurve (theCurve, CurveColor);
if (WAIT_A_LITTLE) return;
Handle(Geom_BSplineCurve) aBSpline = GeomConvert::CurveToBSplineCurve(theCurve);
drawCurve (aBSpline, BSplineColor);
}
//////////////////////////////////////////////////////////////////////
// Sample functions
//////////////////////////////////////////////////////////////////////
//================================================================
// Function : Convert_Presentation::sampleCircle
// Purpose :
//================================================================
void Convert_Presentation::sampleCircle()
{
gp_Pnt aOrigin (0,0,0);
gp_Dir aDir (1,0,0);
gp_Ax2 aAxis (aOrigin, aDir);
Standard_Real aRadius = 300;
Handle(Geom_Circle) aCurve = new Geom_Circle (aAxis, aRadius);
TCollection_AsciiString aText (
" gp_Pnt aOrigin (0,0,0);" EOL
" gp_Dir aDir (1,0,0);" EOL
" gp_Ax2 aAxis (aOrigin, aDir);" EOL
" Standard_Real aRadius = 300;" EOL
" Handle(Geom_Circle) aCurve = new Geom_Circle (aAxis, aRadius);" EOL
);
drawCurveAndItsBSpline (aCurve, "Circle", aText);
}
//================================================================
// Function : Convert_Presentation::sampleEllipse
// Purpose :
//================================================================
void Convert_Presentation::sampleEllipse()
{
gp_Pnt aOrigin (0,0,0);
gp_Dir aDir (1,0,0);
gp_Ax2 aMajorAxis (aOrigin, aDir);
Standard_Real aMajorRadius = 300;
Standard_Real aMinorRadius = 150;
Handle(Geom_Ellipse) aCurve =
new Geom_Ellipse (aMajorAxis, aMajorRadius, aMinorRadius);
TCollection_AsciiString aText (
" gp_Pnt aOrigin (0,0,0);" EOL
" gp_Dir aDir (1,0,0);" EOL
" gp_Ax2 aAxis (aOrigin, aDir);" EOL
" Standard_Real aMajorRadius = 300;" EOL
" Standard_Real aMinorRadius = 150;" EOL
" Handle(Geom_Ellipse) aCurve = " EOL
" new Geom_Ellipse (aAxis, aMajorRadius, aMinorRadius);" EOL
);
drawCurveAndItsBSpline (aCurve, "Ellipse", aText);
}
//================================================================
// Function : Convert_Presentation::sampleBezier
// Purpose :
//================================================================
void Convert_Presentation::sampleBezier()
{
TCollection_AsciiString aText (
" Standard_Real aPolesCoords[][3] = {" EOL
" {0,0,0},{0,1,0},{1,1,0},{1,2,0},{2,2,0},{2,1,0},{3,1,0},{3,0,0},{2,0,0},{2,-1,0}," EOL
" {3,-1,0},{3,-2,0},{4,-2,0},{4,-1,0},{5,-1,0},{5,0,0},{6,0,0},{6,-1,0},{7,-1,0}," EOL
" {7,0,0},{8,0,0},{8,1,0}" EOL
" };" EOL
" TColgp_Array1OfPnt aPoles (1, sizeof(aPolesCoords)/(sizeof(Standard_Real)*2));" EOL
" " EOL
" for (Standard_Integer i=1; i <= aPoles.Upper(); i++)" EOL
" aPoles(i) = gp_Pnt (aPolesCoords[i-1][0]*100, " EOL
" aPolesCoords[i-1][1]*100, " EOL
" aPolesCoords[i-1][2]*100);" EOL
" " EOL
" Handle(Geom_BezierCurve) aCurve = new Geom_BezierCurve (aPoles);" EOL
);
Standard_Real aPolesCoords[][3] = {
{0,0,0},{0,1,0},{1,1,0},{1,2,0},{2,2,0},{2,1,0},{3,1,0},{3,0,0},{2,0,0},{2,-1,0},
{3,-1,0},{3,-2,0},{4,-2,0},{4,-1,0},{5,-1,0},{5,0,0},{6,0,0},{6,-1,0},{7,-1,0},
{7,0,0},{8,0,0},{8,1,0}
};
TColgp_Array1OfPnt aPoles (1, sizeof(aPolesCoords)/(sizeof(Standard_Real)*3));
for (Standard_Integer i=1; i <= aPoles.Upper(); i++)
aPoles(i) = gp_Pnt (aPolesCoords[i-1][0]*150-500,
aPolesCoords[i-1][1]*150,
aPolesCoords[i-1][2]*150);
Handle(Geom_BezierCurve) aCurve = new Geom_BezierCurve (aPoles);
drawCurveAndItsBSpline (aCurve, "BezierCurve", aText);
}
//================================================================
// Function : Convert_Presentation::sampleBezierSurface
// Purpose :
//================================================================
void Convert_Presentation::sampleBezierSurface()
{
getAISContext()->EraseAll();
Standard_CString aName = "BezierSurface";
// Create a BezierSurface
TColgp_Array2OfPnt aPoles(1,2,1,4); // 8 points
TColStd_Array2OfReal aWeights(1,2,1,4);
// initializing array of points
aPoles.SetValue(1,1,gp_Pnt(0,10,0)); aPoles.SetValue(1,2,gp_Pnt(3.3,6.6,3));
aPoles.SetValue(1,3,gp_Pnt(6.6,6.6,-3)); aPoles.SetValue(1,4,gp_Pnt(10,10,0));
aPoles.SetValue(2,1,gp_Pnt(0,0,0)); aPoles.SetValue(2,2,gp_Pnt(3.3,3.3,-3));
aPoles.SetValue(2,3,gp_Pnt(6.6,3.3,3)); aPoles.SetValue(2,4,gp_Pnt(10,0,0));
// scaling poles
for (Standard_Integer i=1; i <= aPoles.ColLength(); i++)
for (Standard_Integer j=1; j <= aPoles.RowLength(); j++)
aPoles(i,j).ChangeCoord() = aPoles(i,j).Coord() * 100 + gp_XYZ(-500,-500,0);
//initializing array of weights
aWeights.SetValue(1,1,1); aWeights.SetValue(1,2,3);
aWeights.SetValue(1,3,9); aWeights.SetValue(1,4,1);
aWeights.SetValue(2,1,1); aWeights.SetValue(2,2,2);
aWeights.SetValue(2,3,5); aWeights.SetValue(2,4,1);
Handle(Geom_BezierSurface) aSurface =
new Geom_BezierSurface(aPoles, aWeights);
TCollection_AsciiString aText (
" // Create a BezierSurface" EOL
" TColgp_Array2OfPnt aPoles(1,2,1,4); // 8 points" EOL
" TColStd_Array2OfReal aWeights(1,2,1,4);" EOL
" // initializing array of points" EOL
" aPoles.SetValue(1,1,gp_Pnt(0,10,0)); aPoles.SetValue(1,2,gp_Pnt(3.3,6.6,3));" EOL
" aPoles.SetValue(1,3,gp_Pnt(6.6,6.6,-3)); aPoles.SetValue(1,4,gp_Pnt(10,10,0));" EOL
" aPoles.SetValue(2,1,gp_Pnt(0,0,0)); aPoles.SetValue(2,2,gp_Pnt(3.3,3.3,-3));" EOL
" aPoles.SetValue(2,3,gp_Pnt(6.6,3.3,3)); aPoles.SetValue(2,4,gp_Pnt(10,0,0)); " EOL
" // scaling poles" EOL
" for (Standard_Integer i=1; i <= aPoles.ColLength(); i++)" EOL
" for (Standard_Integer j=1; j <= aPoles.RowLength(); j++)" EOL
" aPoles(i,j).ChangeCoord() = aPoles(i,j).Coord() * 100 + gp_XYZ(-500,-500,0);" EOL
" //initializing array of weights" EOL
" aWeights.SetValue(1,1,1); aWeights.SetValue(1,2,3);" EOL
" aWeights.SetValue(1,3,9); aWeights.SetValue(1,4,1);" EOL
" aWeights.SetValue(2,1,1); aWeights.SetValue(2,2,2);" EOL
" aWeights.SetValue(2,3,5); aWeights.SetValue(2,4,1);" EOL
" Handle(Geom_BezierSurface) aSurface =" EOL
" new Geom_BezierSurface(aPoles, aWeights);" EOL
);
drawSurfaceAndItsBSpline (aSurface, aName, aText);
}
//================================================================
// Function : OCCDemo_Presentation::sampleCylindricalSurface
// Purpose :
//================================================================
void Convert_Presentation::sampleCylindricalSurface()
{
getAISContext()->EraseAll();
Standard_CString aName = "Cylindrical Surface";
TCollection_AsciiString aText (
" // creating an axis parallel to Y axis" EOL
" gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,1,0));" EOL EOL
" // creating a cylindrical surface along anAx with radius = 100" EOL
" Handle(Geom_CylindricalSurface) aCylSurface = new Geom_CylindricalSurface(anAx, 100);" EOL EOL
" // only finit surfaces can be converted to BSpline surfaces, " EOL
" // cylindrical surface is infinite, it must be trimmed" EOL
" Handle(Geom_RectangularTrimmedSurface) aSurface = " EOL
" new Geom_RectangularTrimmedSurface(aCylSurface, 0, 2*PI, -1000, 1000, Standard_True, Standard_True);" EOL);
// creating an axis parallel to Y axis
gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,1,0));
// creating a cylindrical surface along anAx with radius = 4
Handle(Geom_CylindricalSurface) aCylSurface = new Geom_CylindricalSurface(anAx, 100);
// only finit surfaces can be converted to BSpline surfaces,
// cylindrical surface is infinite, it must be trimmed
Handle(Geom_RectangularTrimmedSurface) aSurface =
new Geom_RectangularTrimmedSurface(aCylSurface, 0, 2*PI, -1000, 1000, Standard_True, Standard_True);
drawSurfaceAndItsBSpline(aSurface, aName, aText);
}
//================================================================
// Function : OCCDemo_Presentation::sampleRevolSurface
// Purpose :
//================================================================
void Convert_Presentation::sampleRevolSurface()
{
FitMode=false;
ResetView();
SetViewCenter(176.84682,102.12892);
SetViewScale(0.69326);
getAISContext()->EraseAll();
Standard_CString aName = "Surface of revolution";
TCollection_AsciiString aText (
" // creating a curve for revolution. Let it be a Bezier curve." EOL
" Handle(Geom_BezierCurve) aBezierCurve;" EOL EOL
" // array of the bezier curve poles" EOL
" TColgp_Array1OfPnt aPoles(1,4);" EOL
" // array of the poles' weights" EOL
" TColStd_Array1OfReal aWeights(1,4);" EOL EOL
" aPoles(1) = gp_Pnt(0, 0, 0); aWeights(1) = 1;" EOL
" aPoles(2) = gp_Pnt(150, 250, 0); aWeights(2) =75;" EOL
" aPoles(3) = gp_Pnt(350, 150, 0); aWeights(3) =120;" EOL
" aPoles(4) = gp_Pnt(500, 500, 0); aWeights(4) = 1;" EOL EOL
" // creating a bezier curve" EOL
" aBezierCurve = new Geom_BezierCurve(aPoles, aWeights);" EOL EOL
" // creating a surface of revolution of the bezier curve around Y axis" EOL
" gp_Ax1 anAx(gp_Pnt(0, 0, 0), gp_Dir(0,1,0));" EOL
" Handle(Geom_SurfaceOfRevolution) aSurface = new Geom_SurfaceOfRevolution(aBezierCurve, anAx);" EOL
);
// array of the bezier curve poles
TColgp_Array1OfPnt aPoles(1,4);
// array of the poles' weights
TColStd_Array1OfReal aWeights(1,4);
aPoles(1) = gp_Pnt(0, 0, 0); aWeights(1) = 1;
aPoles(2) = gp_Pnt(150, 250, 0); aWeights(2) =75;
aPoles(3) = gp_Pnt(350, 150, 0); aWeights(3) =120;
aPoles(4) = gp_Pnt(500, 500, 0); aWeights(4) = 1;
Handle(Geom_BezierCurve) aBezierCurve = new Geom_BezierCurve(aPoles, aWeights);
drawCurve(aBezierCurve);
// creating a surface of revolution of the bezier curve around Y axis
gp_Ax1 anAx(gp_Pnt(0,0,0), gp_Dir(0,1,0));
Handle(Geom_SurfaceOfRevolution) aSurface = new Geom_SurfaceOfRevolution(aBezierCurve, anAx);
drawSurfaceAndItsBSpline (aSurface, aName, aText);
FitMode=true;
}
//================================================================
// Function : Convert_Presentation::sampleToroidalSurface
// Purpose :
//================================================================
void Convert_Presentation::sampleToroidalSurface()
{
getAISContext()->EraseAll();
Standard_CString aName = "Toroidal surface";
TCollection_AsciiString aText (
" // creating an axis parallel to Y axis" EOL
" gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,1,0));" EOL
" // creating a toroidal surface with major radius = 240 and minor radius = 120" EOL
" Handle(Geom_ToroidalSurface) aSurface = new Geom_ToroidalSurface(anAx, 240, 120);" EOL);
// creating an axis parallel to Y axis
gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,1,0));
// creating a toroidal surface with major radius = 240 and minor radius = 120
Handle(Geom_ToroidalSurface) aSurface = new Geom_ToroidalSurface(anAx, 240, 120);
drawSurfaceAndItsBSpline(aSurface, aName, aText);
}
//================================================================
// Function : Convert_Presentation::sampleConicalSurface
// Purpose :
//================================================================
void Convert_Presentation::sampleConicalSurface()
{
getAISContext()->EraseAll();
Standard_CString aName = "Conical surface";
TCollection_AsciiString aText (
" // creating an axis parallel to Z axis" EOL
" gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,0,1)); " EOL
" // creating a conical surface with base radius = 10 and angle = 20 deg" EOL
" Handle(Geom_ConicalSurface) aConicalSurface = new Geom_ConicalSurface(anAx,PI/9., 10);" EOL EOL
" // only finit surfaces can be converted to BSpline surfaces, " EOL
" // conical surface is infinite, it must be trimmed" EOL
" Handle(Geom_RectangularTrimmedSurface) aSurface = " EOL
" new Geom_RectangularTrimmedSurface(aConicalSurface, 0, 2*PI, -1000, 1000, Standard_True, Standard_True);" EOL);
// creating an axis parallel to Z axis
gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,0,1));
// creating a conical surface with base radius = 10 and angle = 20 deg
Handle(Geom_ConicalSurface) aConicalSurface = new Geom_ConicalSurface(anAx,PI/9., 10);
// only finit surfaces can be converted to BSpline surfaces,
// conical surface is infinite, it must be trimmed
Handle(Geom_RectangularTrimmedSurface) aSurface =
new Geom_RectangularTrimmedSurface(aConicalSurface, 0, 2*PI, -1000, 1000, Standard_True, Standard_True);
drawSurfaceAndItsBSpline(aSurface, aName, aText);
}
//================================================================
// Function : Convert_Presentation::sampleSphericalSurface
// Purpose :
//================================================================
void Convert_Presentation::sampleSphericalSurface()
{
getAISContext()->EraseAll();
Standard_CString aName = "Spherical surface";
TCollection_AsciiString aText (
"// creating an axis parallel to Z axis" EOL
"gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,0,1));" EOL
"// creating a spherical surface with radius = 300" EOL
"Handle(Geom_SphericalSurface) aSurface = new Geom_SphericalSurface(anAx,300);" EOL);
// creating an axis parallel to Z axis
gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,0,1));
// creating a spherical surface with radius = 300
Handle(Geom_SphericalSurface) aSurface = new Geom_SphericalSurface(anAx,300);
drawSurfaceAndItsBSpline(aSurface, aName, aText);
}

View File

@ -1,55 +0,0 @@
// Convert_Presentation.h: interface for the Convert_Presentation class.
// Conversion of elementary geometry to BSpline curves and surfaces
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_Convert_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_Convert_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class Geom_Curve;
class Geom_Surface;
class Quantity_Color;
class Convert_Presentation : public OCCDemo_Presentation
{
public:
// Construction
Convert_Presentation();
public:
// Iteration on samples
virtual void DoSample();
// one phase of iterations
private:
// Sample functions
void sampleCircle();
void sampleEllipse();
void sampleBezier();
void sampleBezierSurface();
void sampleCylindricalSurface();
void sampleRevolSurface();
void sampleToroidalSurface();
void sampleConicalSurface();
void sampleSphericalSurface();
void drawCurveAndItsBSpline (Handle(Geom_Curve) theCurve,
const Standard_CString theName, TCollection_AsciiString& theText);
void drawSurfaceAndItsBSpline (Handle(Geom_Surface) theSurface,
const Standard_CString theName, TCollection_AsciiString& theText);
private:
// Array of pointers to sample functions
typedef void (Convert_Presentation::*PSampleFuncType)();
static const PSampleFuncType SampleFuncs[];
int myNbFuncs;
};
#endif // !defined(AFX_Convert_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,428 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="DCA"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/DCA.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Release/DCA.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/DCA.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/DCA.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/DCA.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Debug/DCA.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/DCA.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/DCA.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="DCA_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="DCA_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +0,0 @@
// DCA_Presentation.h: interface for the DCA_Presentation class.
// Geometry Direct Construction Algorithms
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DCA_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_DCA_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class DCA_Presentation : public OCCDemo_Presentation
{
public:
// Construction
DCA_Presentation();
public:
// Iteration on samples
virtual void DoSample();
// one phase of iterations
private:
// Sample functions
void sampleLine();
void sampleParabola();
void sampleHyperbola();
void sampleCircle();
void sampleEllipse();
void samplePlane();
void sampleCylindricalSurface();
void sampleToroidalSurface();
void sampleConicalSurface();
void sampleSphericalSurface();
void Comment(const Standard_CString theTitle,TCollection_AsciiString& theText);
private:
// Array of pointers to sample functions
typedef void (DCA_Presentation::*PSampleFuncType)();
static const PSampleFuncType SampleFuncs[];
};
#endif // !defined(AFX_DCA_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,359 +0,0 @@
DBRep_DrawableShape
CASCADE Topology V1, (c) Matra-Datavision
Locations 1
1
1 0 0 0
0 1 0 0
0 0 1 0
Curve2ds 24
1 0 0 1 0
1 0 0 1 0
1 300 0 0 -1
1 0 0 0 1
1 0 -400 1 0
1 0 0 1 0
1 0 0 0 -1
1 0 0 0 1
1 0 0 1 0
1 0 400 1 0
1 300 0 0 -1
1 400 0 0 1
1 0 -400 1 0
1 0 400 1 0
1 0 0 0 -1
1 400 0 0 1
1 0 0 0 1
1 0 0 1 0
1 300 0 0 1
1 0 0 1 0
1 0 0 0 1
1 0 400 1 0
1 300 0 0 1
1 0 400 1 0
Curves 12
1 0 0 0 0 0 1
1 0 0 300 -0 1 0
1 0 400 0 0 0 1
1 0 0 0 -0 1 0
1 400 0 0 0 0 1
1 400 0 300 0 1 0
1 400 400 0 0 0 1
1 400 0 0 -0 1 0
1 0 0 0 1 0 -0
1 0 0 300 1 0 -0
1 0 400 0 1 0 -0
1 0 400 300 1 0 -0
Polygon3D 0
PolygonOnTriangulations 24
2 1 2
p 1.6000000008 1 0 300
2 1 4
p 1.6000000008 1 0 300
2 2 3
p 1.6000000008 1 0 400
2 1 2
p 1.6000000008 1 0 400
2 4 3
p 1.6000000008 1 0 300
2 1 4
p 1.6000000008 1 0 300
2 1 4
p 1.6000000008 1 0 400
2 1 2
p 1.6000000008 1 0 400
2 1 2
p 1.6000000008 1 0 300
2 2 3
p 1.6000000008 1 0 300
2 2 3
p 1.6000000008 1 0 400
2 4 3
p 1.6000000008 1 0 400
2 4 3
p 1.6000000008 1 0 300
2 2 3
p 1.6000000008 1 0 300
2 1 4
p 1.6000000008 1 0 400
2 4 3
p 1.6000000008 1 0 400
2 1 2
p 1.6000000008 1 0 400
2 1 4
p 1.6000000008 1 0 400
2 4 3
p 1.6000000008 1 0 400
2 1 4
p 1.6000000008 1 0 400
2 1 2
p 1.6000000008 1 0 400
2 2 3
p 1.6000000008 1 0 400
2 4 3
p 1.6000000008 1 0 400
2 2 3
p 1.6000000008 1 0 400
Surfaces 6
1 0 0 0 1 0 -0 0 0 1 0 -1 0
1 0 0 0 -0 1 0 0 0 1 1 0 -0
1 0 0 300 0 0 1 1 0 -0 -0 1 0
1 0 400 0 -0 1 0 0 0 1 1 0 -0
1 0 0 0 0 0 1 1 0 -0 -0 1 0
1 400 0 0 1 0 -0 0 0 1 0 -1 0
Triangulations 6
4 2 1 1.6000000008
0 0 0 0 0 300 0 400 300 0 400 0 0 0 300 0 300 -400 0 -400 1 4 3 3 2 1
4 2 1 1.6000000008
0 0 0 400 0 0 400 0 300 0 0 300 0 0 0 400 300 400 300 0 2 1 4 4 3 2
4 2 1 1.6000000008
0 0 300 0 400 300 400 400 300 400 0 300 0 0 0 400 400 400 400 0 2 1 4 4 3 2
4 2 1 1.6000000008
0 400 0 400 400 0 400 400 300 0 400 300 0 0 0 400 300 400 300 0 2 1 4 4 3 2
4 2 1 1.6000000008
0 0 0 0 400 0 400 400 0 400 0 0 0 0 0 400 400 400 400 0 2 1 4 4 3 2
4 2 1 1.6000000008
400 0 0 400 0 300 400 400 300 400 400 0 0 0 300 0 300 -400 0 -400 1 4 3 3 2 1
TShapes 31
Ve
1e-07
0 0 300
0 0
0101100
*
Ve
1e-07
0 0 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 1 0 0 300
2 1 1 0 0 300
2 2 2 0 0 300
6 1 1 0
6 2 2 0
0
0101000
-31 0 +30 0 *
Ve
1e-07
0 400 300
0 0
0101100
*
Ed
1e-07 1 1 0
1 2 0 0 400
2 3 1 0 0 400
2 4 3 0 0 400
6 3 1 0
6 4 3 0
0
0101000
-28 0 +31 0 *
Ve
1e-07
0 400 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 3 0 0 300
2 5 1 0 0 300
2 6 4 0 0 300
6 5 1 0
6 6 4 0
0
0101000
-28 0 +26 0 *
Ed
1e-07 1 1 0
1 4 0 0 400
2 7 1 0 0 400
2 8 5 0 0 400
6 7 1 0
6 8 5 0
0
0101000
-26 0 +30 0 *
Wi
0101000
-29 0 -27 0 +25 0 +24 0 *
Fa
0 1e-07 1 0
2 1
0111000
+23 0 *
Ve
1e-07
400 0 300
0 0
0101100
*
Ve
1e-07
400 0 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 5 0 0 300
2 9 6 0 0 300
2 10 2 0 0 300
6 9 6 0
6 10 2 0
0
0101000
-21 0 +20 0 *
Ve
1e-07
400 400 300
0 0
0101100
*
Ed
1e-07 1 1 0
1 6 0 0 400
2 11 6 0 0 400
2 12 3 0 0 400
6 11 6 0
6 12 3 0
0
0101000
-18 0 +21 0 *
Ve
1e-07
400 400 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 7 0 0 300
2 13 6 0 0 300
2 14 4 0 0 300
6 13 6 0
6 14 4 0
0
0101000
-18 0 +16 0 *
Ed
1e-07 1 1 0
1 8 0 0 400
2 15 6 0 0 400
2 16 5 0 0 400
6 15 6 0
6 16 5 0
0
0101000
-16 0 +20 0 *
Wi
0101000
-19 0 -17 0 +15 0 +14 0 *
Fa
0 1e-07 6 0
2 6
0111000
+13 0 *
Ed
1e-07 1 1 0
1 9 0 0 400
2 17 2 0 0 400
2 18 5 0 0 400
6 17 2 0
6 18 5 0
0
0101000
-20 0 +30 0 *
Ed
1e-07 1 1 0
1 10 0 0 400
2 19 2 0 0 400
2 20 3 0 0 400
6 19 2 0
6 20 3 0
0
0101000
-21 0 +31 0 *
Wi
0101000
-11 0 -19 0 +10 0 +29 0 *
Fa
0 1e-07 2 0
2 2
0111000
+9 0 *
Ed
1e-07 1 1 0
1 11 0 0 400
2 21 4 0 0 400
2 22 5 0 0 400
6 21 4 0
6 22 5 0
0
0101000
-16 0 +26 0 *
Ed
1e-07 1 1 0
1 12 0 0 400
2 23 4 0 0 400
2 24 3 0 0 400
6 23 4 0
6 24 3 0
0
0101000
-18 0 +28 0 *
Wi
0101000
-7 0 -15 0 +6 0 +25 0 *
Fa
0 1e-07 4 0
2 4
0111000
+5 0 *
Wi
0101000
-24 0 -7 0 +14 0 +11 0 *
Fa
0 1e-07 5 0
2 5
0111000
+3 0 *
Co
1100000
-22 1 +12 1 -8 1 +4 1 -2 1 *
+1 0
0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

View File

@ -1,84 +0,0 @@
80
-8 8 -1
-8 4 -1
-8 1 -1
-7 -2 -1
-8 -4 0
-6 -6 0
-3 -7 -1
-1 -4 -1
1 -6 0
3 -7 0
6 -7 -1
7 -5 -1
6 -1 -1
8 1 0
7 4 0
7 8 0
5 7 -1
2 8 -1
-2 7 -1
-4 8 0
-2 6 0
-6 6 0
-7 4 -1
-5 2 -1
-4 1 -1
-6 -2 0
-6 -4 0
-5 -6 0
-2 -5 0
0 -7 0
3 -6 -1
5 -5 -1
6 -3 -1
4 -2 0
3 -1 0
3 0 0
4 2 -1
6 4 -1
4 6 -1
1 7 -1
-4 7 -1
-6 7 -1
-5 5 -1
-6 2 -1
-5 0 0
-4 -2 -1
-3 -4 -1
-1 -2 -1
0 0 0
2 -2 0
4 -4 -1
6 -5 -1
8 -3 -1
7 -1 -1
7 1 0
5 3 0
4 5 0
2 4 0
-1 3 -1
-2 5 -1
-3 5 0
-5 3 0
-3 2 1
-3 0 1
-5 -2 1
-7 -4 0
-7 -7 0
-5 -7 0
-4 -6 -1
2 -5 -1
5 -2 -1
5 0 -1
7 3 0
6 6 0
5 5 -1
3 7 -1
2 5 0
2 3 0
-1 2 0
-1 5 0

View File

@ -1,933 +0,0 @@
DBRep_DrawableShape
CASCADE Topology V1, (c) Matra-Datavision
Locations 2
1
1 0 0 0
0 1 0 0
0 0 1 60
2 1 -1 0
Curve2ds 24
1 0 0 0 1
1 19.999999999999996 0 0 -1
1 0 0 0 1
1 25.000000000000004 0 0 -1
1 -4.7123889803846897 0 1 0
2 10.000000000000007 20 0 -1 -1 -0 20
1 -1.5707963267948966 0 1 0
2 45 25 0 -1 -1 -0 15
1 -3.1415926535897931 0 1 0
2 55.000000000000014 20 0 -1 -1 -0 20
1 1.5707963267948963 0 0 1
1 10.000000000000011 0 0 -1
1 -4.7123889803846897 60 1 0
2 10.000000000000007 20 0 -1 -1 -0 20
1 1.5707963267948963 0 0 1
1 14.999999999999996 0 0 -1
1 -1.5707963267948966 60 1 0
2 45 25 0 -1 -1 -0 15
1 -3.1415926535897931 60 1 0
2 55.000000000000014 20 0 -1 -1 -0 20
1 0 0 0 1
1 25.000000000000011 0 0 -1
1 1.5707963267948968 0 0 1
1 20.000000000000007 0 0 -1
Curves 25
1 30 0 0 1.2246467991473532e-16 1 0
1 30.000000000000007 19.999999999999996 0 0 0 1
1 30 25.000000000000004 0 0 0 1
8 4.7123889803846897 6.2831853071795862
2 10.000000000000007 20 0 -0 -0 -1 0 -1 0 -1 0 0 20
8 1.5707963267948966 3.1415926535897931
2 45 25 0 -0 -0 -1 0 -1 0 -1 0 0 15
1 0 0 0 1 0 0
1 29.900146484375 40 0 1 0 0
1 0 58.910888671875 0 0 -1 -0
8 3.1415926535897931 4.7123889803846897
2 55.000000000000014 20 0 -0 -0 -1 0 -1 0 -1 0 0 20
1 108.22705078125 60 0 -1 1.2246467991473532e-16 0
1 75.000000000000014 38.518310546875 0 -2.4492935982947064e-16 -1 0
1 104.99999999999999 7.9039948198875589e-16 0 3.6739403974420594e-16 1 0
1 76.573486328125 0 0 1 0 0
1 10.000000000000011 0 0 0 0 1
8 4.7123889803846897 6.2831853071795862
2 10.000000000000007 20 60 -0 -0 -1 0 -1 0 -1 0 0 20
1 45 40 0 0 0 1
8 1.5707963267948966 3.1415926535897931
2 45 25 60 -0 -0 -1 0 -1 0 -1 0 0 15
8 3.1415926535897931 4.7123889803846897
2 55.000000000000014 20 60 -0 -0 -1 0 -1 0 -1 0 0 20
1 0 0 0 0 0 1
1 55.000000000000014 40 0 0 0 1
1 0 60.000000000000014 0 0 0 1
1 75.000000000000014 19.999999999999996 0 0 0 1
1 105.00000000000001 60 0 0 0 1
1 75 0 0 0 0 1
1 105 0 0 0 0 1
Polygon3D 0
PolygonOnTriangulations 103
2 1 2
p 2.00000008 1 20 25
2 1 2
p 5.40000003800001 1 20 25
2 1 3
p 6.00000002 1 -0 60
2 1 6
p 6.8500000095 1 -0 60
2 2 4
p 6.00000002 1 -0 60
2 1 5
p 7.00000001 1 -0 60
2 2 4
p 7.00000001 1 -0 60
2 3 4
p 2.00000008 1 20 25
2 1 2
p 5.40000003800001 1 20 25
5 1 3 4 5 2
p 6.00000002 1 4.71238898038469 5.10508806208341 5.49778714378214 5.89048622548086 6.28318530717959
4 2 7 8 6
p 6.49435328175437 1 1.5707963267949 2.0943951023932 2.61799387799149 3.14159265358979
4 1 2 3 4
p 6.00000002 1 1.5707963267949 2.0943951023932 2.61799387799149 3.14159265358979
4 2 6 7 8
p 10.50000002 1 1.5707963267949 2.0943951023932 2.61799387799149 3.14159265358979
2 9 3
p 4.00000008 1 0 10
2 1 2
p 6.00000002 1 0 10
2 6 10
p 4.00000008000001 1 15.099853515625 25.099853515625
2 1 2
p 6.00000002 1 15.099853515625 25.099853515625
2 8 10
p 10.50000002 1 15.099853515625 25.099853515625
2 1 3
p 6.00000002 1 -1.08911132812501 58.910888671875
2 2 4
p 6.00000002 1 -1.08911132812501 58.910888671875
2 8 1
p 10.50000002 1 -1.08911132812501 58.910888671875
2 8 6
p 10.50000002 1 -1.08911132812501 58.910888671875
2 9 7
p 10.50000002 1 -1.08911132812501 58.910888671875
2 12 10
p 10.50000002 1 -1.08911132812501 58.910888671875
2 12 10
p 10.50000002 1 -1.08911132812501 58.910888671875
2 11 9
p 10.50000002 1 -1.08911132812501 58.910888671875
2 11 9
p 10.50000002 1 -1.08911132812501 58.910888671875
2 11 9
p 10.50000002 1 -1.08911132812501 58.910888671875
2 12 10
p 10.50000002 1 -1.08911132812501 58.910888671875
5 1 3 4 5 2
p 6.00000002 1 3.14159265358979 3.53429173528852 3.92699081698724 4.31968989868597 4.71238898038469
5 10 12 13 14 15
p 10.50000002 1 3.14159265358979 3.53429173528852 3.92699081698724 4.31968989868597 4.71238898038469
2 7 8
p 10.50000002 1 3.22705078124999 108.22705078125
2 1 3
p 12.600000004 1 3.22705078124999 108.22705078125
2 2 4
p 12.600000004 1 3.22705078124999 108.22705078125
2 7 8
p 12.600000004 1 3.22705078124999 108.22705078125
2 12 8
p 12.600000004 1 3.22705078124999 108.22705078125
2 13 9
p 12.600000004 1 3.22705078124999 108.22705078125
2 17 12
p 12.600000004 1 3.22705078124999 108.22705078125
2 17 12
p 12.600000004 1 3.22705078124999 108.22705078125
2 15 11
p 12.600000004 1 3.22705078124999 108.22705078125
2 15 11
p 12.600000004 1 3.22705078124999 108.22705078125
2 16 11
p 12.600000004 1 3.22705078124999 108.22705078125
2 17 12
p 12.600000004 1 3.22705078124999 108.22705078125
2 1 2
p 6.00000002 1 18.518310546875 38.518310546875
2 15 17
p 10.50000002 1 18.518310546875 38.518310546875
2 1 3
p 6.00000002 1 -7.90399481988751e-16 60
2 2 4
p 6.00000002 1 -7.90399481988751e-16 60
2 6 7
p 10.50000002 1 -7.90399481988751e-16 60
2 14 12
p 10.50000002 1 -7.90399481988751e-16 60
2 15 13
p 10.50000002 1 -7.90399481988751e-16 60
2 19 17
p 10.50000002 1 -7.90399481988751e-16 60
2 19 17
p 10.50000002 1 -7.90399481988751e-16 60
2 17 15
p 10.50000002 1 -7.90399481988751e-16 60
2 17 15
p 10.50000002 1 -7.90399481988751e-16 60
2 18 16
p 10.50000002 1 -7.90399481988751e-16 60
2 19 17
p 10.50000002 1 -7.90399481988751e-16 60
2 2 4
p 6.00000002 1 -1.573486328125 28.426513671875
2 1 3
p 6.00000002 1 -1.573486328125 28.426513671875
2 5 6
p 10.50000002 1 -1.573486328125 28.426513671875
2 13 14
p 10.50000002 1 -1.573486328125 28.426513671875
2 14 15
p 10.50000002 1 -1.573486328125 28.426513671875
2 18 19
p 10.50000002 1 -1.573486328125 28.426513671875
2 18 19
p 10.50000002 1 -1.573486328125 28.426513671875
2 16 17
p 10.50000002 1 -1.573486328125 28.426513671875
2 16 17
p 10.50000002 1 -1.573486328125 28.426513671875
2 17 18
p 10.50000002 1 -1.573486328125 28.426513671875
2 18 19
p 10.50000002 1 -1.573486328125 28.426513671875
5 2 8 9 10 7
p 6.00000002 1 -0 15 30 45 60
5 2 3 4 5 6
p 7.242500003475 1 -0 15 30 45 60
5 6 11 12 13 7
p 6.00000002 1 4.71238898038469 5.10508806208341 5.49778714378214 5.89048622548086 6.28318530717959
5 1 3 4 5 6
p 10.50000002 1 4.71238898038469 5.10508806208341 5.49778714378214 5.89048622548086 6.28318530717959
5 4 7 8 9 6
p 6.00000002 1 -0 15 30 45 60
5 1 3 4 5 6
p 7.2500000035 1 -0 15 30 45 60
4 5 10 11 6
p 6.00000002 1 1.5707963267949 2.0943951023932 2.61799387799149 3.14159265358979
4 2 6 7 8
p 10.50000002 1 1.5707963267949 2.0943951023932 2.61799387799149 3.14159265358979
4 2 7 8 9
p 10.50000002 1 1.5707963267949 2.0943951023932 2.61799387799149 3.14159265358979
2 10 6
p 4.00000008 1 0 10
2 7 6
p 6.00000002 1 0 10
2 8 10
p 4.00000008000001 1 15.099853515625 25.099853515625
2 6 7
p 6.00000002 1 15.099853515625 25.099853515625
2 9 11
p 10.50000002 1 15.099853515625 25.099853515625
5 6 11 12 13 7
p 6.00000002 1 3.14159265358979 3.53429173528852 3.92699081698724 4.31968989868597 4.71238898038469
5 11 13 14 15 16
p 10.50000002 1 3.14159265358979 3.53429173528852 3.92699081698724 4.31968989868597 4.71238898038469
2 6 7
p 6.00000002 1 18.518310546875 38.518310546875
2 16 18
p 10.50000002 1 18.518310546875 38.518310546875
2 1 2
p 6.00000002 1 0 60
2 3 4
p 7.200000004 1 0 60
2 1 7
p 7.200000004 1 0 60
2 1 7
p 7.200000004 1 0 60
2 1 7
p 7.200000004 1 0 60
2 2 7
p 6.00000002 1 -0 60
2 1 6
p 7.262500003175 1 -0 60
2 1 2
p 6.00000002 1 0 60
5 2 8 9 10 7
p 6.00000002 1 -0 15 30 45 60
5 1 3 4 5 6
p 7.26312500315875 1 -0 15 30 45 60
2 3 4
p 6.00000002 1 0 60
2 1 2
p 10.50000002 1 0 60
2 3 4
p 6.00000002 1 0 60
2 1 2
p 7.263150003158 1 0 60
2 2 7
p 7.263150003158 1 0 60
2 2 7
p 7.263150003158 1 0 60
2 3 4
p 6.00000002 1 0 60
2 1 2
p 7.2631575031579 1 0 60
Surfaces 12
1 30 0 0 -1 1.2246467991473532e-16 0 1.2246467991473532e-16 1 0 0 0 -1
2 10.000000000000007 20 0 0 0 1 1 -1.2246467991473532e-16 0 -1.2246467991473532e-16 -1 0 20
2 45 25 0 0 0 1 -1 1.2246467991473532e-16 0 1.2246467991473532e-16 1 -0 15
1 0 0 -0 0 0 1 1 0 -0 -0 1 0
2 55.000000000000014 20 0 0 0 1 -0 1 0 1 0 -0 20
1 0 0 0 0 1 0 1 0 0 0 0 -1
1 30.000000000000004 40 0 0 1 0 1 0 0 0 0 -1
1 0 60.000000000000014 0 1 0 -0 0 -1 0 0 -0 -1
1 75.000000000000014 40 0 1 -2.4492935982947064e-16 0 -2.4492935982947064e-16 -1 0 0 -0 -1
1 105.00000000000001 60 0 -1.2246467991473532e-16 -1 0 -1 1.2246467991473532e-16 0 -0 0 -1
1 104.99999999999999 5.2262034970892032e-30 0 -1 3.6739403974420594e-16 0 3.6739403974420594e-16 1 0 0 0 -1
1 75 0 0 0 1 0 1 0 0 0 0 -1
Triangulations 27
4 2 1 4.2500000475
30 20 0 30 25 0 30 20 60 30 25 60 20 0 25 0 20 -60 25 -60 1 3 4 4 2 1
18 16 1 9.46901254039447
30 20 0 30 25 0 10 0 0 27.3205080756888 10 0 20 2.67949192431122 0 32.0096189432334 32.5 0 37.5 37.9903810567666 0 45 40 0 0 0 0 55 40 0 0 60 0 62.6536686473018 38.4775906502257 0 69.142135623731 34.142135623731 0 73.4775906502257 27.6536686473018 0 75 20 0 105 60 0 75 0 0 105 0 0 30 20 30 25 10 0 27.3205080756888 10 20 2.67949192431122 32.0096189432334 32.5 37.5 37.9903810567666 45 40 0 0 55 40 0 60 62.6536686473018 38.4775906502257 69.142135623731 34.142135623731 73.4775906502257 27.6536686473018 75 20 105 60 75 0 105 0 2 9 3 5 4 3 1 3 4 11 2 6 11 9 2 6 7 11 3 1 2 11 7 8 15 18 14 18 15 17 14 18 16 10 16 11 12 13 16 16 13 14 12 16 10 10 11 8
13 11 1 6.212500017375
30 20 0 10 0 0 28.4775906502257 12.3463313526982 0 24.1421356237309 5.85786437626904 0 17.6536686473018 1.52240934977426 0 30 20 60 10 0 60 10 0 15 10 0 30 10 0 45 28.4775906502257 12.3463313526982 60 24.1421356237309 5.85786437626904 60 17.6536686473018 1.52240934977426 60 0 0 1.5707963267949 0 0.392699081698725 0 0.785398163397449 0 1.17809724509617 0 0 60 1.5707963267949 60 1.5707963267949 15 1.5707963267949 30 1.5707963267949 45 0.392699081698725 60 0.785398163397449 60 1.17809724509617 60 1 3 11 3 4 12 11 6 1 12 11 3 4 5 12 5 2 8 5 8 9 13 9 10 9 13 5 10 7 13 5 13 12
4 2 1 5.00000005
30 15 0 30 25 0 30 15 60 30 25 60 15 0 25 0 15 -60 25 -60 1 3 4 4 2 1
11 9 1 6.2500000175
30 25 0 32.0096189432334 32.5 0 37.5 37.9903810567666 0 45 40 0 30 25 60 45 40 60 45 40 15 45 40 30 45 40 45 32.0096189432334 32.5 60 37.5 37.9903810567666 60 0 0 0.523598775598299 0 1.0471975511966 0 1.5707963267949 0 0 60 1.5707963267949 60 1.5707963267949 15 1.5707963267949 30 1.5707963267949 45 0.523598775598299 60 1.0471975511966 60 1 2 10 1 10 5 10 2 3 10 3 11 8 3 7 8 11 3 11 9 6 9 11 8 7 3 4
19 17 1 9.636363662
30 20 0 30 25 0 28.4775906502257 12.3463313526982 0 24.1421356237309 5.85786437626904 0 17.6536686473018 1.52240934977426 0 10 0 0 32.0096189432334 32.5 0 37.5 37.9903810567666 0 45 40 0 0 0 0 55 40 0 0 60 0 62.6536686473018 38.4775906502257 0 69.142135623731 34.142135623731 0 73.4775906502257 27.6536686473018 0 75 20 0 105 60 0 75 0 0 105 0 0 30 20 30 25 28.4775906502257 12.3463313526982 24.1421356237309 5.85786437626904 17.6536686473018 1.52240934977426 10 0 32.0096189432334 32.5 37.5 37.9903810567666 45 40 0 0 55 40 0 60 62.6536686473018 38.4775906502257 69.142135623731 34.142135623731 73.4775906502257 27.6536686473018 75 20 105 60 75 0 105 0 2 10 6 6 5 3 4 3 5 10 2 12 6 3 1 2 6 1 2 7 12 12 7 8 17 14 15 18 19 16 16 19 15 17 15 19 11 12 9 11 13 17 17 13 14 17 12 11 9 12 8
17 15 1 8.34071314453163
30 15 0 30 25 0 15 -1.77635683940025e-15 0 27.9903810567666 7.5 0 22.5 2.00961894323342 0 45 40 0 32.0096189432334 32.5 0 37.5 37.9903810567666 0 0 0 0 55 40 0 0 60 0 75 20 0 65 37.3205080756888 0 72.3205080756888 30 0 105 60 0 75 0 0 105 0 0 30 15 30 25 15 -1.77635683940025e-15 27.9903810567666 7.5 22.5 2.00961894323342 45 40 32.0096189432334 32.5 37.5 37.9903810567666 0 0 55 40 0 60 75 20 65 37.3205080756888 72.3205080756888 30 105 60 75 0 105 0 2 9 3 5 4 3 1 3 4 11 2 7 11 9 2 3 1 2 11 7 8 14 12 15 17 12 16 15 12 17 10 11 6 10 13 15 15 13 14 15 11 10 6 11 8
7 5 1 6.61062501186875
0 0 0 10 0 0 10 0 15 10 0 30 10 0 45 10 0 60 0 0 60 0 0 10 0 10 -15 10 -30 10 -45 10 -60 0 -60 1 7 4 5 7 6 5 4 7 3 2 1 4 3 1
7 5 1 6.312500015875
45 40 0 55 40 0 45 40 15 45 40 30 45 40 45 45 40 60 55 40 60 15 0 25 0 15 -15 15 -30 15 -45 15 -60 25 -60 5 6 7 4 5 7 4 2 3 2 4 7 2 1 3
4 2 1 6.300000016
0 60 0 0 60 60 0 0 0 0 0 60 0 0 0 -60 60 0 60 -60 1 2 4 4 3 1
8 6 1 10.762500018
0 0 0 30 0 0 30 40 0 75 40 0 75 0 0 105 0 0 105 60 0 0 60 0 0 0 30 0 30 40 75 40 75 0 105 0 105 60 0 60 1 2 3 8 3 4 3 8 1 5 6 4 4 7 8 7 4 6
14 12 1 9.24182756286783
30 0 0 30 20 0 50 40 0 32.6794919243112 30 0 40 37.3205080756888 0 0 0 0 55 40 0 0 60 0 75 20 0 65 37.3205080756888 0 72.3205080756888 30 0 105 60 0 75 0 0 105 0 0 30 0 30 20 50 40 32.6794919243112 30 40 37.3205080756888 0 0 55 40 0 60 75 20 65 37.3205080756888 72.3205080756888 30 105 60 75 0 105 0 6 1 2 6 2 8 8 4 5 4 8 2 5 3 8 8 3 7 13 14 9 9 14 12 7 10 12 11 12 10 12 11 9 7 12 8
15 13 1 9.42591379663392
30 0 0 30 20 0 31.5224093497743 27.6536686473018 0 35.857864376269 34.142135623731 0 42.3463313526982 38.4775906502257 0 50 40 0 0 0 0 55 40 0 0 60 0 75 20 0 65 37.3205080756888 0 72.3205080756888 30 0 105 60 0 75 0 0 105 0 0 30 0 30 20 31.5224093497743 27.6536686473018 35.857864376269 34.142135623731 42.3463313526982 38.4775906502257 50 40 0 0 55 40 0 60 75 20 65 37.3205080756888 72.3205080756888 30 105 60 75 0 105 0 7 1 2 7 2 3 9 3 4 3 9 7 4 5 9 9 5 6 12 10 13 15 10 14 13 10 15 8 13 9 11 13 8 13 11 12 8 9 6
19 17 1 9.3581650520626
30 15 0 30 20 0 15 -1.77635683940025e-15 0 27.9903810567666 7.5 0 22.5 2.00961894323342 0 31.5224093497743 27.6536686473018 0 35.857864376269 34.142135623731 0 42.3463313526982 38.4775906502257 0 50 40 0 0 0 0 55 40 0 0 60 0 62.6536686473018 38.4775906502257 0 69.142135623731 34.142135623731 0 73.4775906502257 27.6536686473018 0 75 20 0 105 60 0 75 0 0 105 0 0 30 15 30 20 15 -1.77635683940025e-15 27.9903810567666 7.5 22.5 2.00961894323342 31.5224093497743 27.6536686473018 35.857864376269 34.142135623731 42.3463313526982 38.4775906502257 50 40 0 0 55 40 0 60 62.6536686473018 38.4775906502257 69.142135623731 34.142135623731 73.4775906502257 27.6536686473018 75 20 105 60 75 0 105 0 2 10 3 5 4 3 1 3 4 10 6 12 10 2 6 6 7 12 3 1 2 12 7 8 17 14 15 18 19 16 16 19 15 17 15 19 11 12 9 11 13 17 17 13 14 17 12 11 9 12 8
19 17 1 9.73570284526792
30 15 0 30 20 0 27.9903810567666 7.5 0 22.5 2.00961894323342 0 15 -1.77635683940025e-15 0 31.5224093497743 27.6536686473018 0 35.857864376269 34.142135623731 0 42.3463313526982 38.4775906502257 0 50 40 0 0 0 0 55 40 0 0 60 0 62.6536686473018 38.4775906502257 0 69.142135623731 34.142135623731 0 73.4775906502257 27.6536686473018 0 75 20 0 105 60 0 75 0 0 105 0 0 30 15 30 20 27.9903810567666 7.5 22.5 2.00961894323342 15 -1.77635683940025e-15 31.5224093497743 27.6536686473018 35.857864376269 34.142135623731 42.3463313526982 38.4775906502257 50 40 0 0 55 40 0 60 62.6536686473018 38.4775906502257 69.142135623731 34.142135623731 73.4775906502257 27.6536686473018 75 20 105 60 75 0 105 0 2 10 5 4 3 5 1 5 3 10 6 12 10 2 6 6 7 12 5 1 2 12 7 8 17 14 15 18 19 16 16 19 15 17 15 19 11 12 9 11 13 17 17 13 14 17 12 11 9 12 8
17 15 1 9.06901255148538
30 15 0 30 25 0 27.9903810567666 7.5 0 22.5 2.00961894323342 0 15 -1.77635683940025e-15 0 32.0096189432334 32.5 0 37.5 37.9903810567666 0 45 40 0 0 0 0 55 40 0 0 60 0 75 20 0 65 37.3205080756888 0 72.3205080756888 30 0 105 60 0 75 0 0 105 0 0 30 15 30 25 27.9903810567666 7.5 22.5 2.00961894323342 15 -1.77635683940025e-15 32.0096189432334 32.5 37.5 37.9903810567666 45 40 0 0 55 40 0 60 75 20 65 37.3205080756888 72.3205080756888 30 105 60 75 0 105 0 2 9 5 4 3 5 1 5 3 11 2 6 11 9 2 5 1 2 11 6 7 14 12 15 17 12 16 15 12 17 10 11 8 10 13 15 15 13 14 15 11 10 8 11 7
13 11 1 6.31562501579375
55 40 0 75 20 0 62.6536686473018 38.4775906502257 0 69.142135623731 34.142135623731 0 73.4775906502257 27.6536686473018 0 55 40 60 75 20 60 75 20 15 75 20 30 75 20 45 62.6536686473018 38.4775906502257 60 69.142135623731 34.142135623731 60 73.4775906502257 27.6536686473018 60 0 0 1.5707963267949 0 0.392699081698724 0 0.785398163397448 0 1.17809724509617 0 0 60 1.5707963267949 60 1.5707963267949 15 1.5707963267949 30 1.5707963267949 45 0.392699081698724 60 0.785398163397448 60 1.17809724509617 60 1 3 11 3 4 12 11 6 1 12 11 3 4 5 12 5 2 8 5 8 9 13 9 10 9 13 5 10 7 13 5 13 12
8 6 1 10.50000002
0 0 0 30 0 0 30 40 0 75 40 0 75 0 0 105 0 0 105 60 0 0 60 0 0 0 30 0 30 40 75 40 75 0 105 0 105 60 0 60 1 2 3 8 3 4 3 8 1 5 6 4 4 7 8 7 4 6
4 2 1 11.550000012
105 60 0 105 60 60 0 60 0 0 60 60 0 0 0 -60 105 0 105 -60 1 2 4 4 3 1
7 5 1 6.63156876157919
75 20 0 75 0 0 75 20 15 75 20 30 75 20 45 75 20 60 75 0 60 20 0 40 0 20 -15 20 -30 20 -45 20 -60 40 -60 5 6 7 4 5 7 4 2 3 2 4 7 2 1 3
4 2 1 6.31578939078948
105 0 0 105 0 60 105 60 0 105 60 60 0 0 0 -60 60 0 60 -60 1 2 4 4 3 1
4 2 1 6.3157875157895
75 0 0 75 0 60 105 0 0 105 0 60 0 0 0 -60 30 0 30 -60 1 2 4 4 3 1
4 2 1 6.00000002
0 0 0 0 0 60 30 0 0 30 0 60 0 0 0 -60 30 0 30 -60 1 2 4 4 3 1
7 5 1 6.6107875118645
0 0 0 15 -1.77635683940025e-15 0 15 -1.77635683940025e-15 15 15 -1.77635683940025e-15 30 15 -1.77635683940025e-15 45 15 -1.77635683940025e-15 60 0 0 60 0 0 15 0 15 -15 15 -30 15 -45 15 -60 0 -60 1 7 4 5 7 6 5 4 7 3 2 1 4 3 1
7 5 1 6.612500011875
0 0 0 15 -1.77635683940025e-15 0 15 -1.77635683940025e-15 15 15 -1.77635683940025e-15 30 15 -1.77635683940025e-15 45 15 -1.77635683940025e-15 60 0 0 60 0 0 15 0 15 -15 15 -30 15 -45 15 -60 0 -60 1 7 4 5 7 6 5 4 7 3 2 1 4 3 1
4 2 1 6.31575001579
75 40 0 75 40 60 75 0 0 75 0 60 0 0 0 -60 40 0 40 -60 1 2 4 4 3 1
7 5 1 6.63157688657898
75 20 0 75 0 0 75 20 15 75 20 30 75 20 45 75 20 60 75 0 60 20 0 40 0 20 -15 20 -30 20 -45 20 -60 40 -60 5 6 7 4 5 7 4 2 3 2 4 7 2 1 3
TShapes 75
Ve
1e-07
30 20 0
0 0
0101100
*
Ve
1e-07
30 25 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 1 0 20 25
6 1 1 0
6 2 2 0
0
0101000
+75 0 -74 0 *
Ve
1e-07
30 20 60
0 0
0101100
*
Ed
1e-07 1 1 0
1 2 0 -0 60
2 1 2 0 -0 60
2 2 1 0 -0 60
4 G1 2 0 1 0
6 3 1 0
6 4 3 0
0
0101000
+75 0 -72 0 *
Ve
1e-07
30 25 60
0 0
0101100
*
Ed
1e-07 1 1 0
1 3 0 -0 60
2 3 3 0 -0 60
2 4 1 0 -0 60
4 G1 3 0 1 0
6 5 4 0
6 6 5 0
6 7 1 0
0
0101000
+74 0 -70 0 *
Ed
1e-07 1 1 0
1 1 0 20 25
6 8 1 2
6 9 6 0
0
0101000
+72 2 -70 2 *
Wi
0101100
-73 0 +71 0 -69 0 +68 1 *
Fa
0 1e-07 1 0
2 1
0101000
+67 0 *
Ve
1e-07
10 0 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 4 0 4.71238898038469 6.28318530717959
2 5 2 0 4.71238898038469 6.28318530717959
2 6 4 0 4.71238898038469 6.28318530717959
6 10 3 0
0
0101000
+75 0 -65 0 *
Ve
1e-07
45 40 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 5 0 1.5707963267949 3.14159265358979
2 7 3 0 1.5707963267949 3.14159265358979
2 8 4 0 1.5707963267949 3.14159265358979
6 11 7 0
6 12 5 0
6 13 2 0
0
0101000
+74 0 -63 0 *
Ve
1e-07
0 0 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 6 0 0 10
6 14 2 0
6 15 8 0
0
0101000
-65 0 +61 0 *
Ve
1e-07
55 40 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 7 0 15.099853515625 25.099853515625
6 16 7 0
6 17 9 0
6 18 2 0
0
0101000
+63 0 -59 0 *
Ve
1e-07
0 60 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 8 0 -1.08911132812501 58.910888671875
6 19 10 0
6 20 10 2
6 21 11 0
6 22 12 0
6 23 13 0
6 24 14 0
6 25 15 0
6 26 7 0
6 27 16 0
6 28 2 0
6 29 6 0
0
0101000
+57 0 -61 0 *
Ve
1e-07
75 20 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 9 0 3.14159265358979 4.71238898038469
2 9 5 0 3.14159265358979 4.71238898038469
2 10 4 0 3.14159265358979 4.71238898038469
6 30 17 0
6 31 2 0
0
0101000
+59 0 -55 0 *
Ve
1e-07
105 60 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 10 0 3.22705078124999 108.22705078125
6 32 18 0
6 33 19 0
6 34 19 2
6 35 11 0
6 36 12 0
6 37 13 0
6 38 14 0
6 39 15 0
6 40 7 0
6 41 16 0
6 42 2 0
6 43 6 0
0
0101000
+53 0 -57 0 *
Ve
1e-07
75 0 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 11 0 18.518310546875 38.518310546875
6 44 20 0
6 45 2 0
0
0101000
+55 0 -51 0 *
Ve
1e-07
105 0 0
0 0
0101100
*
Ed
1e-07 1 1 0
1 12 0 -7.90399481988751e-16 60
6 46 21 0
6 47 21 2
6 48 11 0
6 49 12 0
6 50 13 0
6 51 14 0
6 52 15 0
6 53 7 0
6 54 16 0
6 55 2 0
6 56 6 0
0
0101000
+49 0 -53 0 *
Ed
1e-07 1 1 0
1 13 0 -1.573486328125 28.426513671875
6 57 22 2
6 58 22 0
6 59 11 0
6 60 12 0
6 61 13 0
6 62 14 0
6 63 15 0
6 64 7 0
6 65 16 0
6 66 2 0
6 67 6 0
0
0101000
+51 0 -49 0 *
Wi
0101100
+73 0 -64 0 +62 0 +60 0 +58 0 +56 0 +54 0 +52 0 +50 0 +48 0
+47 0 *
Fa
0 1e-07 4 0
2 2
0101000
+46 0 *
Ve
1e-07
10 0 60
0 0
0101100
*
Ed
1e-07 1 1 0
1 14 0 -0 60
2 11 2 0 -0 60
2 12 6 0 -0 60
4 G1 2 0 6 0
6 68 3 0
6 69 8 0
0
0101000
+65 0 -44 0 *
Ed
1e-07 1 1 0
1 15 0 4.71238898038469 6.28318530717959
2 13 2 0 4.71238898038469 6.28318530717959
2 14 4 1 4.71238898038469 6.28318530717959
6 70 3 0
6 71 6 1
0
0101000
+72 0 -44 0 *
Wi
0101100
+64 0 -71 0 +43 0 -42 0 *
Fa
0 0 2 0
2 3
0101000
+41 0 *
Ve
1e-07
45 40 60
0 0
0101100
*
Ed
1e-07 1 1 0
1 16 0 -0 60
2 15 3 0 -0 60
2 16 7 0 -0 60
4 G1 3 0 7 0
6 72 5 0
6 73 9 0
0
0101000
+63 0 -39 0 *
Ed
1e-07 1 1 0
1 17 0 1.5707963267949 3.14159265358979
2 17 3 0 1.5707963267949 3.14159265358979
2 18 4 1 1.5707963267949 3.14159265358979
6 74 5 0
6 75 16 1
6 76 6 1
0
0101000
+70 0 -39 0 *
Wi
0101100
+62 0 -69 0 +38 0 -37 0 *
Fa
0 0 3 0
2 5
0101000
+36 0 *
Ed
1e-07 1 1 0
1 6 0 0 10
6 77 6 0
6 78 8 2
0
0101000
-44 2 +61 0 *
Ve
1e-07
55 40 60
0 0
0101100
*
Ed
1e-07 1 1 0
1 7 0 15.099853515625 25.099853515625
6 79 16 0
6 80 9 2
6 81 6 0
0
0101000
+39 2 -33 2 *
Ve
1e-07
75 20 60
0 0
0101100
*
Ed
1e-07 1 1 0
1 18 0 3.14159265358979 4.71238898038469
2 19 5 0 3.14159265358979 4.71238898038469
2 20 4 1 3.14159265358979 4.71238898038469
6 82 17 0
6 83 6 1
0
0101000
+33 0 -31 0 *
Ed
1e-07 1 1 0
1 11 0 18.518310546875 38.518310546875
6 84 20 2
6 85 6 0
0
0101000
+31 2 -51 0 *
Wi
0101100
+68 1 -42 0 +37 0 +34 1 +32 1 +56 1 +30 0 +52 1 +29 1 +48 1
+47 1 *
Fa
0 1e-07 4 0
2 6
0101000
+28 2 *
Ed
1e-07 1 1 0
1 19 0 0 60
6 86 23 0
6 87 10 0
6 88 24 0
6 89 25 0
6 90 8 0
0
0101000
+61 0 -61 1 *
Wi
0101100
-60 0 -43 0 +26 0 +34 1 *
Fa
0 1e-07 6 0
2 8
0101000
+25 0 *
Ed
1e-07 1 1 0
1 20 0 -0 60
2 21 5 0 -0 60
2 22 7 0 -0 60
4 G1 5 0 7 0
6 91 9 0
6 92 17 0
0
0101000
+59 0 -33 0 *
Wi
0101100
-58 0 +38 0 -23 0 +32 1 *
Fa
0 1e-07 7 0
2 9
0101000
+22 0 *
Ed
1e-07 1 1 0
1 21 0 0 60
6 93 10 0
0
0101000
+57 0 -57 1 *
Wi
0101000
+20 0 -26 0 -56 0 +56 1 *
Fa
0 1e-07 8 0
2 10
0101000
+19 0 *
Ed
1e-07 1 1 0
1 22 0 -0 60
2 23 5 0 -0 60
2 24 9 0 -0 60
4 G1 5 0 9 0
6 94 17 0
6 95 20 0
0
0101000
+55 0 -31 0 *
Wi
0101100
+54 0 -23 0 +17 0 -30 0 *
Fa
0 0 5 0
2 17
0101000
+16 0 *
Ed
1e-07 1 1 0
1 23 0 0 60
6 96 21 0
6 97 19 0
0
0101000
+53 0 -53 1 *
Wi
0101000
+14 0 -20 0 -52 0 +52 1 *
Fa
0 1e-07 10 0
2 19
0101000
+13 0 *
Ed
1e-07 1 1 0
1 24 0 0 60
6 98 26 0
6 99 22 0
6 100 27 0
6 101 20 0
0
0101000
+51 0 -51 1 *
Wi
0101100
-50 0 +17 0 -11 0 +29 1 *
Fa
0 1e-07 9 0
2 20
0101000
+10 0 *
Ed
1e-07 1 1 0
1 25 0 0 60
6 102 22 0
6 103 21 0
0
0101000
+49 0 -49 1 *
Wi
0101000
+8 0 -14 0 -48 0 +48 1 *
Fa
0 1e-07 11 0
2 21
0101000
+7 0 *
Wi
0101000
+11 0 -8 0 -47 0 +47 1 *
Fa
0 1e-07 12 0
2 22
0101000
+5 0 *
Sh
0101100
-66 0 -45 0 -40 0 +35 0 +27 1 -24 0 -21 0 -18 0 +15 0 -12 0
-9 0 -6 0 -4 0 *
So
0100000
+3 0 *
Co
1100000
+2 0 *
+1 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1013 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -1,284 +0,0 @@
DBRep_DrawableShape
CASCADE Topology V1, (c) Matra-Datavision
Locations 0
Curve2ds 24
1 0 0 0 1
1 0 0 1 0
1 0 8 0.88921182764210061 -0.457495710997814
1 0 0 0.88921182764210061 -0.457495710997814
1 5.8309518948453007 3 0 1
1 3 3 1 0
1 0 0 0.86386842558136012 0.50371752330406572
1 0 0 0.6355525695988512 -0.77205759582837941
1 0 0 0 1
1 0 10 1 0
1 0 8 0.88921182764210061 -0.457495710997814
1 0 -10 0.88921182764210061 0.457495710997814
1 5.8309518948453007 3 0 1
1 3 7 1 0
1 0 0 0.88921182764210061 0.457495710997814
1 0 -10 0.88921182764210061 0.457495710997814
1 0 0 0 1
1 0 0 0 -1
1 8 0 0 1
1 0 0 0 -1
1 3 3 0 1
1 5.8309518948453007 -3 0 -1
1 5 3 0 1
1 5.8309518948453007 -3 0 -1
Curves 12
1 0 0 0 1 0 0
1 8 0 0 -0.457495710997814 0.457495710997814 0.76249285166302339
1 3 3 5 1 0 0
1 0 0 0 0.457495710997814 0.76249285166302339 0.457495710997814
1 0 10 0 1 0 0
1 8 10 0 -0.457495710997814 -0.457495710997814 0.76249285166302339
1 3 7 5 1 0 0
1 0 10 0 0.457495710997814 -0.457495710997814 0.76249285166302339
1 0 0 0 -0 1 0
1 8 0 0 -0 1 0
1 3 3 5 -0 1 0
1 5 3 5 -0 1 0
Polygon3D 0
PolygonOnTriangulations 0
Surfaces 6
1 0 0 0 -0 0.8574929257125441 -0.51449575542752646 0 0.51449575542752657 0.85749292571254421 1 0 -0
1 0 0 0 0 -0 1 1 0 0 -0 1 0
1 8 0 0 0.8574929257125441 0 0.51449575542752646 -0.51449575542752657 0 0.85749292571254421 0 -1 0
1 0 0 5 0 -0 1 1 0 0 -0 1 0
1 0 0 0 0.8574929257125441 0 -0.51449575542752646 0.51449575542752657 0 0.85749292571254421 0 -1 0
1 0 10 0 0 0.8574929257125441 0.51449575542752646 0 -0.51449575542752657 0.85749292571254421 1 0 -0
Triangulations 0
TShapes 34
Ve
1e-07
8 0 0
0 0
0101101
*
Ve
1e-07
0 0 0
0 0
0101101
*
Ed
1e-07 1 1 0
1 1 0 0 8
2 1 1 0 0 8
2 2 2 0 0 8
0
0101000
-34 0 +33 0 *
Ve
1e-07
5 3 5
0 0
0101101
*
Ed
1e-07 1 1 0
1 2 0 0 6.557438524302
2 3 1 0 0 6.557438524302
2 4 3 0 0 6.557438524302
0
0101000
-31 0 +34 0 *
Ve
1e-07
3 3 5
0 0
0101101
*
Ed
1e-07 1 1 0
1 3 0 0 2
2 5 1 0 0 2
2 6 4 0 0 2
0
0101000
-31 0 +29 0 *
Ed
1e-07 1 1 0
1 4 0 0 5.94744424297158
2 7 1 0 0 5.94744424297158
2 8 5 0 0 5.94744424297158
0
0101000
-29 0 +33 0 *
Wi
0101000
-32 0 -30 0 +28 0 +27 0 *
Fa
0 1e-07 1 0
0111000
+26 0 *
Ve
1e-07
8 10 0
0 0
0101101
*
Ve
1e-07
0 10 0
0 0
0101101
*
Ed
1e-07 1 1 0
1 5 0 0 8
2 9 6 0 0 8
2 10 2 0 0 8
0
0101000
-24 0 +23 0 *
Ve
1e-07
5 7 5
0 0
0101101
*
Ed
1e-07 1 1 0
1 6 0 0 6.557438524302
2 11 6 0 0 6.557438524302
2 12 3 0 0 6.557438524302
0
0101000
-21 0 +24 0 *
Ve
1e-07
3 7 5
0 0
0101101
*
Ed
1e-07 1 1 0
1 7 0 0 2
2 13 6 0 0 2
2 14 4 0 0 2
0
0101000
-21 0 +19 0 *
Ed
1e-07 1 1 0
1 8 0 0 6.557438524302
2 15 6 0 0 6.557438524302
2 16 5 0 0 6.557438524302
0
0101000
-19 0 +23 0 *
Wi
0101000
-22 0 -20 0 +18 0 +17 0 *
Fa
0 1e-07 6 0
0111000
+16 0 *
Ed
1e-07 1 1 0
1 9 0 0 10
2 17 2 0 0 10
2 18 5 0 0 10
0
0101000
-23 0 +33 0 *
Ed
1e-07 1 1 0
1 10 0 0 10
2 19 2 0 0 10
2 20 3 0 0 10
0
0101000
-24 0 +34 0 *
Wi
0101000
-14 0 -22 0 +13 0 +32 0 *
Fa
0 1e-07 2 0
0111000
+12 0 *
Ed
1e-07 1 1 0
1 11 0 0 4
2 21 4 0 0 4
2 22 5 0 0 4
0
0101000
-19 0 +29 0 *
Ed
1e-07 1 1 0
1 12 0 0 4
2 23 4 0 0 4
2 24 3 0 0 4
0
0101000
-21 0 +31 0 *
Wi
0101000
-10 0 -18 0 +9 0 +28 0 *
Fa
0 1e-07 4 0
0111000
+8 0 *
Wi
0101000
-27 0 -10 0 +17 0 +14 0 *
Fa
0 1e-07 5 0
0111000
+6 0 *
Wi
0101000
-30 0 -9 0 +20 0 +13 0 *
Fa
0 1e-07 3 0
0111000
+4 0 *
Sh
0101100
-25 0 +15 0 -11 0 +7 0 -5 0 +3 0 *
So
1100100
+2 0 *
+1 0
0

View File

@ -1,284 +0,0 @@
DBRep_DrawableShape
CASCADE Topology V1, (c) Matra-Datavision
Locations 0
Curve2ds 24
1 0 0 0 1
1 0 0 1 0
1 0 8 0.95782628522115143 -0.28734788556634544
1 0 0 1 0
1 10 0 0 1
1 0 0 1 0
1 0 0 1 0
1 0 0 1 0
1 0 0 0 1
1 0 10 1 0
1 0 8 0.96110811751817093 -0.27617238536949701
1 0 -10 0.96110811751817093 0.27617238536949701
1 10.440306508910551 0 0 1
1 0 7 1 0
1 0 0 1 0
1 0 -10 0.95782628522115143 0.28734788556634544
1 0 0 0 1
1 0 0 0 -1
1 8 0 0 1
1 0 0 0 -1
1 0 0 0 1
1 10 0 0 -1
1 5 0 0 1
1 10.440306508910551 0 0 -1
Curves 12
1 0 0 0 1 0 0
1 8 0 0 -0.28734788556634538 0 0.95782628522115132
1 0 0 10 1 0 0
1 0 0 0 0 -0 1
1 0 10 0 1 0 0
1 8 10 0 -0.27617238536949701 -0.27617238536949701 0.9205746178983234
1 0 7 10 1 0 0
1 0 10 0 0 -0.28734788556634538 0.95782628522115132
1 0 0 0 -0 1 0
1 8 0 0 -0 1 0
1 0 0 10 -0 1 0
1 5 0 10 -0 1 0
Polygon3D 0
PolygonOnTriangulations 0
Surfaces 6
1 0 0 0 -0 1 0 0 0 1 1 0 -0
1 0 0 0 0 -0 1 1 0 0 -0 1 0
1 8 0 0 0.95782628522115132 0 0.28734788556634538 -0.28734788556634538 0 0.95782628522115143 0 -1 0
1 0 0 10 0 -0 1 1 0 0 -0 1 0
1 0 0 0 1 0 0 -0 0 1 0 -1 0
1 0 10 0 0 0.95782628522115132 0.28734788556634538 0 -0.28734788556634538 0.95782628522115143 1 0 -0
Triangulations 0
TShapes 34
Ve
1e-07
8 0 0
0 0
0101101
*
Ve
1e-07
0 0 0
0 0
0101101
*
Ed
1e-07 1 1 0
1 1 0 0 8
2 1 1 0 0 8
2 2 2 0 0 8
0
0101000
-34 0 +33 0 *
Ve
1e-07
5 0 10
0 0
0101101
*
Ed
1e-07 1 1 0
1 2 0 0 10.4403065089105
2 3 1 0 0 10.4403065089105
2 4 3 0 0 10.4403065089105
0
0101000
-31 0 +34 0 *
Ve
1e-07
0 0 10
0 0
0101101
*
Ed
1e-07 1 1 0
1 3 0 0 5
2 5 1 0 0 5
2 6 4 0 0 5
0
0101000
-31 0 +29 0 *
Ed
1e-07 1 1 0
1 4 0 0 10
2 7 1 0 0 10
2 8 5 0 0 10
0
0101000
-29 0 +33 0 *
Wi
0101000
-32 0 -30 0 +28 0 +27 0 *
Fa
0 1e-07 1 0
0111000
+26 0 *
Ve
1e-07
8 10 0
0 0
0101101
*
Ve
1e-07
0 10 0
0 0
0101101
*
Ed
1e-07 1 1 0
1 5 0 0 8
2 9 6 0 0 8
2 10 2 0 0 8
0
0101000
-24 0 +23 0 *
Ve
1e-07
5 7 10
0 0
0101101
*
Ed
1e-07 1 1 0
1 6 0 0 10.8627804912002
2 11 6 0 0 10.8627804912002
2 12 3 0 0 10.8627804912002
0
0101000
-21 0 +24 0 *
Ve
1e-07
0 7 10
0 0
0101101
*
Ed
1e-07 1 1 0
1 7 0 0 5
2 13 6 0 0 5
2 14 4 0 0 5
0
0101000
-21 0 +19 0 *
Ed
1e-07 1 1 0
1 8 0 0 10.4403065089105
2 15 6 0 0 10.4403065089105
2 16 5 0 0 10.4403065089105
0
0101000
-19 0 +23 0 *
Wi
0101000
-22 0 -20 0 +18 0 +17 0 *
Fa
0 1e-07 6 0
0111000
+16 0 *
Ed
1e-07 1 1 0
1 9 0 0 10
2 17 2 0 0 10
2 18 5 0 0 10
0
0101000
-23 0 +33 0 *
Ed
1e-07 1 1 0
1 10 0 0 10
2 19 2 0 0 10
2 20 3 0 0 10
0
0101000
-24 0 +34 0 *
Wi
0101000
-14 0 -22 0 +13 0 +32 0 *
Fa
0 1e-07 2 0
0111000
+12 0 *
Ed
1e-07 1 1 0
1 11 0 0 7
2 21 4 0 0 7
2 22 5 0 0 7
0
0101000
-19 0 +29 0 *
Ed
1e-07 1 1 0
1 12 0 0 7
2 23 4 0 0 7
2 24 3 0 0 7
0
0101000
-21 0 +31 0 *
Wi
0101000
-10 0 -18 0 +9 0 +28 0 *
Fa
0 1e-07 4 0
0111000
+8 0 *
Wi
0101000
-27 0 -10 0 +17 0 +14 0 *
Fa
0 1e-07 5 0
0111000
+6 0 *
Wi
0101000
-30 0 -9 0 +20 0 +13 0 *
Fa
0 1e-07 3 0
0111000
+4 0 *
Sh
0101100
-25 0 +15 0 -11 0 +7 0 -5 0 +3 0 *
So
1100100
+2 0 *
+1 0
0

View File

@ -1,428 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Extrema"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/Extrema.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib"
OutputFile=".\../Release/Extrema.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/Extrema.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/Extrema.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/Extrema.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Debug/Extrema.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/Extrema.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/Extrema.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="Extrema_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="Extrema_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,591 +0,0 @@
// Extrema_Presentation.cpp: implementation of the Extrema_Presentation class.
// Calculation of extrema between geometries or shapes
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Extrema_Presentation.h"
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <BRepBuilderAPI_TransitionMode.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <GeomAPI_ExtremaCurveCurve.hxx>
#include <GeomAPI_ExtremaCurveSurface.hxx>
#include <GeomAPI_ExtremaSurfaceSurface.hxx>
#include <GeomAPI_Interpolate.hxx>
#include <GeomFill_Pipe.hxx>
#include <GeomFill_Trihedron.hxx>
#include <Geom_SphericalSurface.hxx>
#include <Geom_ToroidalSurface.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_Circle.hxx>
#include <Geom_BezierSurface.hxx>
#include <gp_Pnt.hxx>
#include <gp_Ax3.hxx>
#include <Precision.hxx>
#include <AIS_Shape.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Edge.hxx>
#ifdef WNT
#define EOL "\r\n"
#else
#define EOL "\n"
#endif
// Initialization of global variable with an instance of this class
OCCDemo_Presentation* OCCDemo_Presentation::Current = new Extrema_Presentation;
// Initialization of array of samples
const Extrema_Presentation::PSampleFuncType Extrema_Presentation::SampleFuncs[] =
{
&Extrema_Presentation::sampleCurveCurve,
&Extrema_Presentation::sampleCurveSur,
&Extrema_Presentation::sampleSurSur,
&Extrema_Presentation::sampleShapeShape,
&Extrema_Presentation::sampleShellShell
};
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Extrema_Presentation::Extrema_Presentation()
{
myIndex = 0;
myNbSamples = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
setName ("Calculation of Extrema");
}
//////////////////////////////////////////////////////////////////////
// Sample execution
//////////////////////////////////////////////////////////////////////
void Extrema_Presentation::DoSample()
{
if (myIndex >=0 && myIndex < myNbSamples)
(this->*SampleFuncs[myIndex])();
}
//================================================================
// Function : displayExtemaEdge
// Purpose : displays an edge between the two given points with white color
//================================================================
void Extrema_Presentation::displayExtemaEdge(const gp_Pnt& p1, const gp_Pnt& p2)
{
Handle(AIS_Shape) anExtremaIO = new AIS_Shape(BRepBuilderAPI_MakeEdge(p1,p2));
anExtremaIO->SetColor(Quantity_NOC_WHITE);
anExtremaIO->SetWidth(3);
drawPoint(p1, Quantity_Color(Quantity_NOC_WHITE));
drawPoint(p2, Quantity_Color(Quantity_NOC_WHITE));
getAISContext()->Display(anExtremaIO);
}
//////////////////////////////////////////////////////////////////////
// Sample functions
//////////////////////////////////////////////////////////////////////
//================================================================
// Function : Extrema_Presentation::samplePoints
// Purpose : curve <-> curve extrema
//================================================================
void Extrema_Presentation::sampleCurveCurve()
{
getAISContext()->EraseAll();
ResetView();
SetViewCenter(282.89618368456, 81.618799162700);
SetViewScale(1.0106109766380);
setResultTitle("Extrema between curve and curve");
TCollection_AsciiString aText(
" // initializing array of bezier curve poles" EOL
" Standard_Real aCoords[][3] = {" EOL
" {0,0,0},{0,1,0},{1,1,0.2},{1,2,0.2},{2,2,0.4},{2,1,0.4},{3,1,0.6},{3,0,0.6}," EOL
" {2,0,0.8},{2,-1,0},{3,-1,0},{3,-2,-0.5},{4,-2,1},{4,-1,1.2},{5,-1,1.2}," EOL
" {5,0,1.4},{6,0,1.4},{6,-1,1.6},{7,-1,1.6},{7,0,1.8},{8,0,1.8},{8,1,2}" EOL
" };" EOL
" Standard_Integer nPoles = sizeof(aCoords)/(sizeof(Standard_Real)*3);" EOL
" TColgp_Array1OfPnt aPoles (1, nPoles);" EOL
" for (Standard_Integer i=0; i < nPoles; i++)" EOL
" aPoles(i+1) = gp_Pnt (aCoords[i][0]*100, aCoords[i][1]*100, aCoords[i][2]*100);" EOL EOL
" // Two curves for finding extrema between them" EOL
" Handle(Geom_Curve) aCurve1 = new Geom_BezierCurve(aPoles);" EOL
" Handle(Geom_Curve) aCurve2 = new Geom_Circle(gp_Ax2(gp_Pnt(100,100,400), gp_Dir(0,0,1)), 300);" EOL EOL
" // Finding extrema between the curves" EOL
" GeomAPI_ExtremaCurveCurve anExtrema (aCurve1, aCurve2);" EOL EOL
" Standard_Real aShortestDistance = anExtrema.LowerDistance();" EOL
" Standard_Real u1, u2;" EOL
" gp_Pnt P1, P2;" EOL
" anExtrema.LowerDistanceParameters(u1, u2);" EOL
" anExtrema.NearestPoints(P1,P2);" EOL EOL
" // iterating through all solutions" EOL
" for (i = 0; i <= anExtrema.NbExtrema(); i++)" EOL
" {" EOL
" Standard_Real aDistance = anExtrema.Distance(i);" EOL
" anExtrema.Parameters(i, u1, u2);" EOL
" anExtrema.Points(i, P1, P2);" EOL
" }" EOL EOL
);
setResultText(aText.ToCString());
// points to build the curves
Standard_Real aCoords[][3] = {
{0,0,0},{0,1,0},{1,1,0.2},{1,2,0.2},{2,2,0.4},{2,1,0.4},{3,1,0.6},{3,0,0.6},
{2,0,0.8},{2,-1,0},{3,-1,0},{3,-2,-0.5},{4,-2,1},{4,-1,1.2},{5,-1,1.2},
{5,0,1.4},{6,0,1.4},{6,-1,1.6},{7,-1,1.6},{7,0,1.8},{8,0,1.8},{8,1,2}
};
Standard_Integer nPoles = sizeof(aCoords)/(sizeof(Standard_Real)*3);
TColgp_Array1OfPnt aPoles (1, nPoles);
for (Standard_Integer i=0; i < nPoles; i++)
aPoles(i+1) = gp_Pnt (aCoords[i][0]*100, aCoords[i][1]*100, aCoords[i][2]*100);
Handle(Geom_Curve) aCurve1 = new Geom_BezierCurve(aPoles);
Handle(Geom_Curve) aCurve2 = new Geom_Circle(gp_Ax2(gp_Pnt(100,100,400), gp_Dir(0,0,1)), 300);
// displaying the curves in the viewer
drawCurve(aCurve1);
if (WAIT_A_LITTLE) return;
drawCurve(aCurve2);
if (WAIT_A_LITTLE) return;
// Finding shortest extrema between the curves
gp_Pnt P1, P2;
GeomAPI_ExtremaCurveCurve anExtrema(aCurve1, aCurve2);
anExtrema.NearestPoints(P1,P2);
displayExtemaEdge(P1,P2);
Standard_Real aShortestDistance = anExtrema.LowerDistance();
Standard_Real u1, u2;
anExtrema.LowerDistanceParameters(u1, u2);
char buffer[256];
sprintf(buffer,
" // DISTANCE BETWEEN THE CURVES = %.2f" EOL
" // PARAMETER ON CURVE1 = %.2f" EOL
" // PARAMETER ON CURVE2 = %.2f" EOL, aShortestDistance, u1, u2);
aText += buffer;
setResultText(aText.ToCString());
}
//================================================================
// Function : Extrema_Presentation::sampleCurveSur
// Purpose : Curve <-> Surface extrema
//================================================================
void Extrema_Presentation::sampleCurveSur()
{
getAISContext()->EraseAll();
ResetView();
SetViewCenter(-107.67723432505, 109.55602570748);
SetViewScale(0.63361834647187);
setResultTitle("Extrema between curve and surface");
TCollection_AsciiString aText(
" // the curve - first object for finding the extrema." EOL
" Handle(Geom_Curve) aCurve;" EOL
" Handle(TColgp_HArray1OfPnt) aPoles = new TColgp_HArray1OfPnt(1, 4);" EOL EOL
" // points to build the curves" EOL
" Standard_Real a[][3] = {{2,1,10},{0,12,0},{5,6,0},{0,10,11}}; " EOL EOL
" // filling the arrays of poles, scaling them, displaying the points" EOL
" for (Standard_Integer i=0; i < 4; i++)" EOL
" aPoles->SetValue(i+1, gp_Pnt(a[i][0]*75-300, a[i][1]*75-300, a[i][2]*75-400));" EOL EOL
" //Creating an interpolation curve" EOL
" GeomAPI_Interpolate aInterpolate1(aPoles, false, Precision::Confusion());" EOL
" aInterpolate1.Perform();" EOL
" if (aInterpolate1.IsDone()) aCurve = aInterpolate1.Curve();" EOL EOL
" // creating an axis parallel to Z axis " EOL
" gp_Ax3 anAx(gp_Pnt(-400, -400, -200), gp_Dir(0,0,1)); " EOL
" // creating a spherical surface" EOL
" Handle(Geom_SphericalSurface) aSurface = new Geom_SphericalSurface(anAx, 1);" EOL EOL
" // Finding extrema between the curve and the surface" EOL
" GeomAPI_ExtremaCurveSurface anExtrema(aCurve, aSurface);" EOL EOL
" Standard_Real aShortestDistance = anExtrema.LowerDistance();" EOL
" Standard_Real w, u, v;" EOL
" gp_Pnt P1, P2;" EOL
" anExtrema.LowerDistanceParameters(w, u, v);" EOL
" anExtrema.NearestPoints(P1,P2);" EOL EOL
" // iterating through all solutions" EOL
" for (i = 0; i <= anExtrema.NbExtrema(); i++)" EOL
" {" EOL
" Standard_Real aDistance = anExtrema.Distance(i);" EOL
" anExtrema.Parameters(i, w, u, v);" EOL
" anExtrema.Points(i, P1, P2);" EOL
" }" EOL EOL
);
setResultText(aText.ToCString());
// the curve - first object for finding the extrema.
Handle(Geom_Curve) aCurve;
Handle(TColgp_HArray1OfPnt) aPoles = new TColgp_HArray1OfPnt(1, 4);
// points to build the curves
Standard_Real a[][3] = {{2,1,10},{0,12,0},{5,6,0},{0,10,11}};
// filling the arrays of poles, scaling them, displaying the points
for (Standard_Integer i=0; i < 4; i++)
aPoles->SetValue(i+1, gp_Pnt(a[i][0]*75-300, a[i][1]*75-300, a[i][2]*75-400));
//Creating an interpolation curve
GeomAPI_Interpolate aInterpolate1(aPoles, false, Precision::Confusion());
aInterpolate1.Perform();
if (aInterpolate1.IsDone()) aCurve = aInterpolate1.Curve();
// creating an axis parallel to Z axis
gp_Ax3 anAx(gp_Pnt(-400, -400, -200), gp_Dir(0,0,1));
// creating a spherical surface - second object to find the extrema between
Handle(Geom_SphericalSurface) aSurface = new Geom_SphericalSurface(anAx, 200);
drawCurve(aCurve);
if (WAIT_A_LITTLE) return;
drawSurface(aSurface);
if (WAIT_A_LITTLE) return;
// Finding extrema between the curve and the surface
gp_Pnt P1, P2;
GeomAPI_ExtremaCurveSurface anExtrema(aCurve, aSurface);
anExtrema.NearestPoints(P1,P2);
displayExtemaEdge(P1,P2);
Standard_Real aShortestDistance = anExtrema.LowerDistance();
Standard_Real w, u, v;
anExtrema.LowerDistanceParameters(w, u, v);
char buffer[256];
sprintf(buffer,
" // DISTANCE BETWEEN THE CURVE AND THE SURFACE = %.2f" EOL
" // PARAMETER ON THE CURVE = %.2f" EOL
" // PARAMETERS ON THE SURFACE: U = %.2f, V = %.2f" EOL, aShortestDistance, w, u, v);
aText += buffer;
setResultText(aText.ToCString());
}
//================================================================
// Function : Extrema_Presentation::sampleSurSur
// Purpose : Surface <-> Surface extrema
//================================================================
void Extrema_Presentation::sampleSurSur()
{
getAISContext()->EraseAll();
setResultTitle("Extrema between surface and surface");
TCollection_AsciiString aText(
" // creating an axis parallel to Z axis" EOL
" gp_Ax3 anAx1(gp_Pnt(-400,-400,-200), gp_Dir(0,0,1)); " EOL
" // creating a spherical surface" EOL
" Handle(Geom_SphericalSurface) aSphericalSur = new Geom_SphericalSurface(anAx1,200);" EOL EOL
" // creating an axis parallel to Y axis " EOL
" gp_Ax3 anAx2(gp_Pnt(300,300,300), gp_Dir(0,0,1)); " EOL
" // creating a toroidal surface" EOL
" Handle(Geom_ToroidalSurface) aToroidalSur = new Geom_ToroidalSurface(anAx2, 300, 100);" EOL EOL
" // Finding extrema between the surfaces" EOL
" GeomAPI_ExtremaSurfaceSurface anExtrema(aSphericalSur,aToroidalSur);" EOL EOL
" Standard_Real aShortestDistance = anExtrema.LowerDistance();" EOL
" Standard_Real u1, v1, u2, v2;" EOL
" gp_Pnt P1, P2;" EOL
" anExtrema.LowerDistanceParameters(u1, v1, u2, v2);" EOL
" anExtrema.NearestPoints(P1,P2);" EOL EOL
" // iterating through all solutions" EOL
" for (i = 0; i <= anExtrema.NbExtrema(); i++)" EOL
" {" EOL
" Standard_Real aDistance = anExtrema.Distance(i);" EOL
" anExtrema.Parameters(i, u1, v1, u2, v2);" EOL
" anExtrema.Points(i, P1, P2);" EOL
" }" EOL EOL
);
setResultText(aText.ToCString());
// creating an axis parallel to Z axis
gp_Ax3 anAx1(gp_Pnt(-400,-400,-200), gp_Dir(0,0,1));
// creating a spherical surface
Handle(Geom_SphericalSurface) aSphericalSur = new Geom_SphericalSurface(anAx1,200);
// creating an axis parallel to Y axis
gp_Ax3 anAx2(gp_Pnt(300,300,300), gp_Dir(0,0,1));
// creating a toroidal surface
Handle(Geom_ToroidalSurface) aToroidalSur = new Geom_ToroidalSurface(anAx2, 300, 100);
drawSurface(aSphericalSur);
if (WAIT_A_LITTLE) return;
drawSurface(aToroidalSur);
if (WAIT_A_LITTLE) return;
// Finding extrema between the surfaces
gp_Pnt P1, P2;
GeomAPI_ExtremaSurfaceSurface anExtrema(aSphericalSur,aToroidalSur);
anExtrema.NearestPoints(P1,P2);
displayExtemaEdge(P1, P2);
Standard_Real aShortestDistance = anExtrema.LowerDistance();
Standard_Real u1, v1, u2, v2;
anExtrema.LowerDistanceParameters(u1, v1, u2, v2);
char buffer[256];
sprintf(buffer,
" // DISTANCE BETWEEN THE SURFACES = %.2f" EOL
" // PARAMETERS ON SURFACE1: U = %.2f, V = %.2f" EOL
" // PARAMETERS ON SURFACE2: U = %.2f, V = %.2f" EOL, aShortestDistance, u1, v1, u2, v2);
aText += buffer;
setResultText(aText.ToCString());
}
//================================================================
// Function : Extrema_Presentation::sampleShapeShape
// Purpose : TopoDS_Shape <-> TopoDS_Shape extrema
//================================================================
void Extrema_Presentation::sampleShapeShape()
{
getAISContext()->EraseAll();
setResultTitle("Extrema between shapes");
TCollection_AsciiString aText(
" Standard_Real a = 500;" EOL
" Standard_Real b = a/2;" EOL
" BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(0, -b, -b), a, a, a);" EOL
" BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(-a,0,0), gp_Dir(.2,-.3,.5)), a/4, a);" EOL EOL
);
setResultText(aText.ToCString());
Standard_Real a = 500;
Standard_Real b = a/2;
BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(0, -b, -b), a, a, a);
BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(-a,0,0), gp_Dir(.2,-.3,.5)), a/4, a);
TopoDS_Solid aShape1 = aBoxMaker.Solid();
TopoDS_Solid aShape2 = aCylMaker.Solid();
doShapeShapeExtrema(aShape1, aShape2, aText);
}
//================================================================
// Function : Extrema_Presentation::sampleShellShell
// Purpose :
//================================================================
void Extrema_Presentation::sampleShellShell()
{
getAISContext()->EraseAll();
setResultTitle("Extrema between two shells");
TCollection_AsciiString aText(
" // building a first shell: the underlaying surface is created" EOL
" // using sweep algorythm. One bezier curve is swept along another bezier curve." EOL
" // creating the curves" EOL
" Standard_Real aCoords1[][3] = {{0,0,0},{10,0,0},{20,10,12},{25,30,20},{50,40,50}};" EOL
" Standard_Real aCoords2[][3] = {{0,0,0},{0,0,10},{0,10,10},{0,10,20}};" EOL
" Standard_Integer nPoles1 = sizeof(aCoords1)/(sizeof(Standard_Real)*3);" EOL
" Standard_Integer nPoles2 = sizeof(aCoords2)/(sizeof(Standard_Real)*3);" EOL
" TColgp_Array1OfPnt aPoles1 (1, nPoles1);" EOL
" TColgp_Array1OfPnt aPoles2 (1, nPoles2);" EOL
" for (Standard_Integer i=0; i < nPoles1; i++)" EOL
" aPoles1(i+1) = gp_Pnt (aCoords1[i][0]*10-250, aCoords1[i][1]*10-250, aCoords1[i][2]*10-50);" EOL
" for (i=0; i < nPoles2; i++)" EOL
" aPoles2(i+1) = gp_Pnt (aCoords2[i][0]*10-250, aCoords2[i][1]*10-250, aCoords2[i][2]*10-50);" EOL EOL
" Handle(Geom_Curve) aPathCurve = new Geom_BezierCurve(aPoles1);" EOL
" Handle(Geom_Curve) aSweepCurve = new Geom_BezierCurve(aPoles2);" EOL EOL
" // creating the surface: sweeping aSweepCurve along aPathCurve" EOL
" GeomFill_Trihedron Option = GeomFill_IsFrenet;" EOL
" GeomFill_Pipe aSweepMaker;" EOL
" aSweepMaker.GenerateParticularCase(Standard_True);" EOL
" aSweepMaker.Init(aPathCurve, aSweepCurve, Option);" EOL
" Standard_Integer NbSeg = 30, MaxDegree = 10;" EOL
" Standard_Real Tol = 1.e-4;" EOL
" aSweepMaker.Perform(Precision::Confusion(), Standard_False, GeomAbs_C2, MaxDegree, NbSeg);" EOL EOL
" // creating a TopoDS_Shell from Geom_Surface" EOL
" TopoDS_Shell aShape1 = BRepBuilderAPI_MakeShell(aSweepMaker.Surface());" EOL EOL
" // creating a second shell based on a bezier surface" EOL
" Standard_Real aSurCoords[][3] = {{-10,-10,-30},{-10,50,40},{-10,70,-20},{50,-10,40}," EOL
" {50,50,0},{50,70,30},{70,-10,20},{70,50,30},{70,70,-20}};" EOL
" TColgp_Array2OfPnt aSurPoles(1,3,1,3);" EOL
" for (i=0; i < 3; i++)" EOL
" for (Standard_Integer j=0; j < 3; j++)" EOL
" aSurPoles(i+1,j+1) = gp_Pnt (aSurCoords[i*3+j][0]*10-250, aSurCoords[i*3+j][1]*10-250, aSurCoords[i*3+j][2]*10-350);" EOL EOL
" Handle(Geom_BezierSurface) aSurface = new Geom_BezierSurface(aSurPoles);" EOL EOL
" // creating a TopoDS_Shell from Geom_Surface" EOL
" TopoDS_Shell aShape2 = BRepBuilderAPI_MakeShell(aSurface);" EOL EOL
);
setResultText(aText.ToCString());
// building a first shell: the underlaying surface is created
// using sweep algorythm. One bezier curve is swept along another bezier curve.
// creating the curves
Standard_Real aCoords1[][3] = {{0,0,0},{10,0,0},{20,10,12},{25,30,20},{50,40,50}};
Standard_Real aCoords2[][3] = {{0,0,0},{0,0,10},{0,10,10},{0,10,20}};
Standard_Integer nPoles1 = sizeof(aCoords1)/(sizeof(Standard_Real)*3);
Standard_Integer nPoles2 = sizeof(aCoords2)/(sizeof(Standard_Real)*3);
TColgp_Array1OfPnt aPoles1 (1, nPoles1);
TColgp_Array1OfPnt aPoles2 (1, nPoles2);
for (Standard_Integer i=0; i < nPoles1; i++)
aPoles1(i+1) = gp_Pnt (aCoords1[i][0]*10-250, aCoords1[i][1]*10-250, aCoords1[i][2]*10-50);
for (i=0; i < nPoles2; i++)
aPoles2(i+1) = gp_Pnt (aCoords2[i][0]*10-250, aCoords2[i][1]*10-250, aCoords2[i][2]*10-50);
Handle(Geom_Curve) aPathCurve = new Geom_BezierCurve(aPoles1);
Handle(Geom_Curve) aSweepCurve = new Geom_BezierCurve(aPoles2);
// creating the surface: sweeping aSweepCurve along aPathCurve
GeomFill_Trihedron Option = GeomFill_IsFrenet;
GeomFill_Pipe aSweepMaker;
aSweepMaker.GenerateParticularCase(Standard_True);
aSweepMaker.Init(aPathCurve, aSweepCurve, Option);
Standard_Integer NbSeg = 30, MaxDegree = 10;
Standard_Real Tol = 1.e-4;
aSweepMaker.Perform(Precision::Confusion(), Standard_False, GeomAbs_C2, MaxDegree, NbSeg);
// creating a TopoDS_Shell from Geom_Surface
TopoDS_Shell aShape1 = BRepBuilderAPI_MakeShell(aSweepMaker.Surface());
// creating a second shell based on a bezier surface
Standard_Real aSurCoords[][3] = {{-10,-10,-30},{-10,50,40},{-10,70,-20},{50,-10,40},
{50,50,0},{50,70,30},{70,-10,20},{70,50,30},{70,70,-20}};
TColgp_Array2OfPnt aSurPoles(1,3,1,3);
for (i=0; i < 3; i++)
for (Standard_Integer j=0; j < 3; j++)
aSurPoles(i+1,j+1) = gp_Pnt (aSurCoords[i*3+j][0]*10-250, aSurCoords[i*3+j][1]*10-250, aSurCoords[i*3+j][2]*10-350);
Handle(Geom_BezierSurface) aSurface = new Geom_BezierSurface(aSurPoles);
// creating a TopoDS_Shell from Geom_Surface
TopoDS_Shell aShape2 = BRepBuilderAPI_MakeShell(aSurface);
// displaying extrema between shape and shape
doShapeShapeExtrema(aShape1, aShape2, aText);
}
//================================================================
// Function : Extrema_Presentation::doShapeShapeExtrema
// Purpose :
//================================================================
void Extrema_Presentation::doShapeShapeExtrema(const TopoDS_Shape& theShape1,
const TopoDS_Shape& theShape2,
TCollection_AsciiString& theText)
{
theText +=
" BRepExtrema_DistShapeShape anExtrema(aShape1, aShape2);" EOL
" if (anExtrema.IsDone())" EOL
" {" EOL
" Standard_Real aShortestDistance = anExtrema.Value();" EOL
" Standard_Real w1, w2, u1, v1, u2, v2;" EOL EOL
" // iterating through ALL solutions, 1 solution in our case" EOL
" for (Standard_Integer i = 1; i <= anExtrema.NbSolution(); i++)" EOL
" {" EOL
" gp_Pnt p1 = anExtrema.PointOnShape1(i);" EOL
" gp_Pnt p2 = anExtrema.PointOnShape2(i);" EOL EOL
" TopoDS_Shape aSupportShape1 = anExtrema.SupportOnShape1(i);" EOL
" TopoDS_Shape aSupportShape2 = anExtrema.SupportOnShape2(i);" EOL EOL
" if (anExtrema.SupportTypeOnShape1() == BRepExtrema::IsOnEdge)" EOL
" anExtrema.ParOnEdgeS1(i, w1);" EOL
" if (anExtrema.SupportTypeOnShape2() == BRepExtrema::IsOnEdge)" EOL
" anExtrema.ParOnEdgeS2(i, w2);" EOL
" if (anExtrema.SupportTypeOnShape1() == BRepExtrema::IsOnFace)" EOL
" anExtrema.ParOnEdgeS1(i, u1, v1);" EOL
" if (anExtrema.SupportTypeOnShape2() == BRepExtrema::IsOnFace)" EOL
" anExtrema.ParOnEdgeS2(i, u2, v2);" EOL
" }" EOL
" }" EOL EOL;
getAISContext()->Display(new AIS_Shape(theShape1));
if (WAIT_A_LITTLE) return;
getAISContext()->Display(new AIS_Shape(theShape2));
if (WAIT_A_LITTLE) return;
// calculating shell-shell extrema
BRepExtrema_DistShapeShape anExtrema(theShape1, theShape2);
if (anExtrema.IsDone())
{
Standard_Real aShortestDistance = anExtrema.Value();
Standard_Real w1, w2, u1, v1, u2, v2;
// displaying ALL solutions
for (Standard_Integer i = 1; i <= anExtrema.NbSolution(); i++)
{
displayExtemaEdge(anExtrema.PointOnShape1(i), anExtrema.PointOnShape2(i));
Handle(AIS_Shape) aSupportShape1 = new AIS_Shape(anExtrema.SupportOnShape1(i));
aSupportShape1->SetMaterial(Graphic3d_NOM_PLASTIC);
aSupportShape1->SetColor(Quantity_NOC_GRAY97);
Handle(AIS_Shape) aSupportShape2 = new AIS_Shape(anExtrema.SupportOnShape2(i));
aSupportShape2->SetMaterial(Graphic3d_NOM_PLASTIC);
aSupportShape2->SetColor(Quantity_NOC_GRAY97);
getAISContext()->Display(aSupportShape1, Standard_False);
getAISContext()->Display(aSupportShape2);
char buffer[512];
sprintf(buffer,
" // DISTANCE BETWEEN THE SHAPES = %.2f" EOL, aShortestDistance);
theText += buffer;
if (anExtrema.SupportTypeShape1(i) == BRepExtrema_IsOnEdge)
{
anExtrema.ParOnEdgeS1(i, w1);
sprintf(buffer,
" // TYPE OF SUPPORTING SHAPE ON SHAPE1 IS \"EDGE\","EOL
" // VALUES OF PARAMETER = %.2f" EOL, w1);
theText += buffer;
}
if (anExtrema.SupportTypeShape2(i) == BRepExtrema_IsOnEdge)
{
anExtrema.ParOnEdgeS2(i, w2);
sprintf(buffer,
" // TYPE OF SUPPORTING SHAPE ON SHAPE2 IS \"EDGE\","EOL
" // VALUES OF PARAMETER = %.2f" EOL, w2);
theText += buffer;
}
if (anExtrema.SupportTypeShape1(i) == BRepExtrema_IsInFace)
{
anExtrema.ParOnFaceS1(i, u1, v1);
sprintf(buffer,
" // TYPE OF SUPPORTING SHAPE ON SHAPE1 IS \"FACE\","EOL
" // VALUES OF PARAMETERS: U = %.2f, V = %.2f" EOL, u1, v1);
theText += buffer;
}
if (anExtrema.SupportTypeShape2(i) == BRepExtrema_IsInFace)
{
anExtrema.ParOnFaceS2(i, u2, v2);
sprintf(buffer,
" // TYPE OF SUPPORTING SHAPE ON SHAPE2 IS \"FACE\","EOL
" // VALUES OF PARAMETERS: U = %.2f, V = %.2f" EOL, u2, v2);
theText += buffer;
}
setResultText(theText.ToCString());
}
}
}

View File

@ -1,45 +0,0 @@
// Extrema_Presentation.h: interface for the Extrema_Presentation class.
// Calculation of extrema between geometries or shapes
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_Extrema_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_Extrema_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class gp_Pnt;
class Extrema_Presentation : public OCCDemo_Presentation
{
public:
// Construction
Extrema_Presentation();
public:
// Iteration on samples
virtual void DoSample();
// one phase of iterations
private:
void displayExtemaEdge(const gp_Pnt&, const gp_Pnt&);
void doShapeShapeExtrema(const TopoDS_Shape&, const TopoDS_Shape&,
TCollection_AsciiString& theText);
// Sample functions
void sampleCurveCurve();
void sampleCurveSur();
void sampleSurSur();
void sampleShapeShape();
void sampleShellShell();
private:
// Array of pointers to sample functions
typedef void (Extrema_Presentation::*PSampleFuncType)();
static const PSampleFuncType SampleFuncs[];
};
#endif // !defined(AFX_Extrema_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,450 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="GProps"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/GProps.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
BrowseInformation="1"
BrowseInformationFile=".\../Release/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Release/GProps.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/GProps.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/GProps.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/GProps.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
BrowseInformation="1"
BrowseInformationFile=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Debug/GProps.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/GProps.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/GProps.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="GProps_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="GProps_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,677 +0,0 @@
// GProps_Presentation.cpp: implementation of the GProps_Presentation class.
// Global Properties of Shapes
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "GProps_Presentation.h"
#include <BRepTools.hxx>
#include <TopoDS_Shape.hxx>
#include <BRep_Builder.hxx>
#include <GProp_PGProps.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_Circle.hxx>
#include <BRepGProp.hxx>
#include <GProp_PrincipalProps.hxx>
#include <Geom_BezierCurve.hxx>
#include <TopoDS_Edge.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Shell.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <AIS_Point.hxx>
#include <TopoDS_Solid.hxx>
#include <ElCLib.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Trsf2d.hxx>
#include <gp_Trsf.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <TopoDS_Compound.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <GeomAPI_PointsToBSplineSurface.hxx>
// Initialization of global variable with an instance of this class
OCCDemo_Presentation* OCCDemo_Presentation::Current = new GProps_Presentation;
// Initialization of array of samples
const GProps_Presentation::PSampleFuncType GProps_Presentation::SampleFuncs[] =
{
&GProps_Presentation::samplePoints,
&GProps_Presentation::sampleCurves,
&GProps_Presentation::sampleSurfaces,
&GProps_Presentation::sampleVolumes,
&GProps_Presentation::sampleSystem
};
#ifdef WNT
#define EOL "\r\n"
#else
#define EOL "\n"
#endif
#define CUSTOM_INERTIAL_ELEMS_COLOR Quantity_NOC_CYAN1
#define MAIN_ELEMS_COLOR Quantity_NOC_RED
#define SEC_AXIS_COLOR Quantity_NOC_GREEN
#define SCALE_FACTOR 15
#define SCALE_FACTOR_FOR_VECTORS SCALE_FACTOR*5
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
GProps_Presentation::GProps_Presentation()
{
myNbSamples = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
setName ("Global Properties of Points, Lines, Surfaces and Volumes");
}
//////////////////////////////////////////////////////////////////////
// Sample execution
//////////////////////////////////////////////////////////////////////
void GProps_Presentation::DoSample()
{
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbSamples)
(this->*SampleFuncs[myIndex])();
}
//////////////////////////////////////////////////////////////////////
// Sample functions
//////////////////////////////////////////////////////////////////////
Standard_Boolean GProps_Presentation::GProps(GProp_GProps& aProps,
gp_Ax1& anAxisForInertialProp,
TCollection_AsciiString& theText,
TCollection_AsciiString theMassStr)
{
theText += EOL
" gp_Pnt aCenterOfMass;// center of mass of the system" EOL
" Standard_Real aMass; // mass of the system" EOL
" " EOL
" Standard_Real aRadiusOfGyration;// radius of gyration around a given axis" EOL
" Standard_Real aMomentOfInertia; // moment of inertia around a given axis" EOL
" " EOL
" Standard_Real aPrincipalRadiusOfGyrationXX; // radiuses of gyration around " EOL
" Standard_Real aPrincipalRadiusOfGyrationYY; // the main inertial axes" EOL
" Standard_Real aPrincipalRadiusOfGyrationZZ;" EOL
"" EOL
" Standard_Real aPrincipalMomentOfInertiaXX; // moments of inertia around " EOL
" Standard_Real aPrincipalMomentOfInertiaYY; // the main inertial axes" EOL
" Standard_Real aPrincipalMomentOfInertiaZZ;" EOL
"" EOL
" gp_Ax1 anAxisForInertialProp; // axis to compute inertial properties" EOL
" // initializing anAxisForInertialProp" EOL
" // ..." EOL
"" EOL
" GProp_PrincipalProps aPrincipalProps; // the object that returns inertial properties" EOL
" " EOL
" gp_Vec aFInertiaAxVec; // inertial axes as they are returned by aPrincipalProps" EOL
" gp_Vec aSInertiaAxVec;" EOL
" gp_Vec aTInertiaAxVec;" EOL
"" EOL
" aCenterOfMass = aProps.CentreOfMass();" EOL
" aMass = aProps.Mass();" EOL
"" EOL
" // axis for calculation gyration and inertia properties" EOL
" aPrincipalProps = aProps.PrincipalProperties();" EOL
"" EOL
" if (!aPrincipalProps.HasSymmetryPoint())" EOL
" {" EOL
" aFInertiaAxVec = aPrincipalProps.FirstAxisOfInertia();" EOL
"" EOL
" // computing a radiuses of gyration and moment of inertia " EOL
" // around the main axes of inertia" EOL
" aPrincipalProps.RadiusOfGyration(aPrincipalRadiusOfGyrationXX, " EOL
" aPrincipalRadiusOfGyrationYY, aPrincipalRadiusOfGyrationZZ);" EOL
" aPrincipalProps.Moments(aPrincipalMomentOfInertiaXX, " EOL
" aPrincipalMomentOfInertiaYY, aPrincipalMomentOfInertiaZZ); " EOL
" " EOL
" if (!aPrincipalProps.HasSymmetryAxis())" EOL
" {" EOL
" aSInertiaAxVec = aPrincipalProps.SecondAxisOfInertia();" EOL
" aTInertiaAxVec = aPrincipalProps.ThirdAxisOfInertia();" EOL
" }" EOL
" }" EOL
" " EOL
" // computing a radius of gyration and moment of inertia around a given axis" EOL
" aRadiusOfGyration = aProps.RadiusOfGyration(anAxisForInertialProp);" EOL
" aMomentOfInertia = aProps.MomentOfInertia(anAxisForInertialProp);" EOL;
setResultText(theText.ToCString());
gp_Pnt aCenterOfMass;// center of mass of the system
Standard_Real aMass; // mass of the system
Standard_Real aRadiusOfGyration;// radius of gyration around a given axis
Standard_Real aMomentOfInertia; // moment of inertia around a given axis
Standard_Real aPrincipalRadiusOfGyrationXX; // radiuses of gyration around
Standard_Real aPrincipalRadiusOfGyrationYY; // the main inertial axes
Standard_Real aPrincipalRadiusOfGyrationZZ;
Standard_Real aPrincipalMomentOfInertiaXX; // moments of inertia around
Standard_Real aPrincipalMomentOfInertiaYY; // the main inertial axes
Standard_Real aPrincipalMomentOfInertiaZZ;
GProp_PrincipalProps aPrincipalProps; // the object that returns inertial properties
gp_Vec aFInertiaAxVec; // inertial axes as they are returned by aPrincipalProps
gp_Vec aSInertiaAxVec;
gp_Vec aTInertiaAxVec;
aCenterOfMass = aProps.CentreOfMass();
aMass = aProps.Mass();
theText = theText + EOL EOL
" //=================================================" EOL EOL
" Total " + theMassStr + " = " + TCollection_AsciiString(aMass) + EOL
" Center of mass: ["+TCollection_AsciiString(aCenterOfMass.X())+","
+TCollection_AsciiString(aCenterOfMass.Y())+","
+TCollection_AsciiString(aCenterOfMass.Z())+"]";
// axis for calculation gyration and inertia properties
aPrincipalProps = aProps.PrincipalProperties();
if (!aPrincipalProps.HasSymmetryPoint())
{
aFInertiaAxVec = aPrincipalProps.FirstAxisOfInertia();
// computing a radiuses of gyration and moment of inertia
// around the main axes of inertia
aPrincipalProps.RadiusOfGyration(aPrincipalRadiusOfGyrationXX,
aPrincipalRadiusOfGyrationYY, aPrincipalRadiusOfGyrationZZ);
aPrincipalProps.Moments(aPrincipalMomentOfInertiaXX,
aPrincipalMomentOfInertiaYY, aPrincipalMomentOfInertiaZZ);
theText = theText + EOL EOL
" Moment of inertia around the first axis of inertia = " + TCollection_AsciiString(aPrincipalMomentOfInertiaXX) + EOL
" Moment of inertia around the second axis of inertia = " + TCollection_AsciiString(aPrincipalMomentOfInertiaYY) + EOL
" Moment of inertia around the third axis of inertia = " + TCollection_AsciiString(aPrincipalMomentOfInertiaZZ) + EOL EOL
" Radius of gyration around the first axis of inertia = " + TCollection_AsciiString(aPrincipalRadiusOfGyrationXX) + EOL
" Radius of gyration around the second axis of inertia = " + TCollection_AsciiString(aPrincipalRadiusOfGyrationYY) + EOL
" Radius of gyration around the third axis of inertia = " + TCollection_AsciiString(aPrincipalRadiusOfGyrationZZ);
if (!aPrincipalProps.HasSymmetryAxis())
{
aSInertiaAxVec = aPrincipalProps.SecondAxisOfInertia();
aTInertiaAxVec = aPrincipalProps.ThirdAxisOfInertia();
}
}
// computing a radius of gyration and moment of inertia around a given axis
aRadiusOfGyration = aProps.RadiusOfGyration(anAxisForInertialProp);
aMomentOfInertia = aProps.MomentOfInertia(anAxisForInertialProp);
theText = theText + EOL + EOL
" Radius of gyration around an axis = " + TCollection_AsciiString(aRadiusOfGyration) + EOL
" Moment of inertia around an axis = " + TCollection_AsciiString(aMomentOfInertia) + EOL;
setResultText(theText.ToCString());
// ========= output =======================================
// display the given axis
gp_Lin aLin(anAxisForInertialProp.Location(), anAxisForInertialProp.Direction());
// aParam = Parameter Of Projection Of CenterOfMass Onto AxisForInertialProp
Standard_Real aParam = ElCLib::Parameter(aLin, aCenterOfMass);
gp_Pnt aProjectedCenterOfMass = ElCLib::Value(aParam, aLin);
gp_Ax2 anInertialCoordSys;
anInertialCoordSys.SetDirection(anAxisForInertialProp.Direction());
anInertialCoordSys.SetLocation(aProjectedCenterOfMass);
// display a point on the axis around which the properties were calculated
drawPoint(aProjectedCenterOfMass, CUSTOM_INERTIAL_ELEMS_COLOR);
// display the axis around which the properties were calculated
gp_Vec aVec(anAxisForInertialProp.Direction());
aVec.SetXYZ(aVec.XYZ()*SCALE_FACTOR_FOR_VECTORS);
drawVector(aProjectedCenterOfMass, aVec, CUSTOM_INERTIAL_ELEMS_COLOR);
if (WAIT_A_SECOND) return Standard_False;
Handle(AIS_Point) aPointIO = drawPoint(
aCenterOfMass, MAIN_ELEMS_COLOR, Standard_False);
aPointIO->UnsetMarker();
aPointIO->SetMarker(Aspect_TOM_O);
getAISContext()->Display(aPointIO);
if (WAIT_A_SECOND) return Standard_False;
// displaying inertial axes, main in red, other use default color
if (!aPrincipalProps.HasSymmetryPoint())
{
aFInertiaAxVec.SetXYZ(aFInertiaAxVec.XYZ()*SCALE_FACTOR_FOR_VECTORS);
drawVector(aCenterOfMass, aFInertiaAxVec, MAIN_ELEMS_COLOR);
if (!aPrincipalProps.HasSymmetryAxis())
{
aSInertiaAxVec.SetXYZ(aSInertiaAxVec.XYZ()*SCALE_FACTOR_FOR_VECTORS);
aTInertiaAxVec.SetXYZ(aTInertiaAxVec.XYZ()*SCALE_FACTOR_FOR_VECTORS);
drawVector(aCenterOfMass, aSInertiaAxVec, SEC_AXIS_COLOR);
drawVector(aCenterOfMass, aTInertiaAxVec, SEC_AXIS_COLOR);
}
if (WAIT_A_SECOND) return Standard_False;
}
// display the cirle with radius = aRadiusOfGyration
Handle(Geom_Circle) aCirc = new Geom_Circle(anInertialCoordSys, aRadiusOfGyration);
drawCurve(aCirc, CUSTOM_INERTIAL_ELEMS_COLOR);
return Standard_True;
}
//================================================================
// Function : GProps_Presentation::samplePoints
// Purpose :
//================================================================
void GProps_Presentation::samplePoints()
{
ResetView();
SetViewCenter(63.470922672300, 35.981561054950);
SetViewScale(4.2572644504009);
setResultTitle("Global Properties of Points");
TCollection_AsciiString aText(
" TColgp_Array1OfPnt aPoints (1, nPoints); // points to analyze" EOL
" TColStd_Array1OfReal aDens (1, nPoints); // dencities of points, weights" EOL
" // initializing arrays of points and densities" EOL
" // ..." EOL
"" EOL
" GProp_PGProps aProps(aPoints, aDens);" EOL
"" EOL
" gp_Pnt aBaryCentre; // geometric centre of shape that consists all the points" EOL
" aBaryCentre = GProp_PGProps::Barycentre(aPoints);" EOL);
// points to build the curves
Standard_Real aCoords[][3] = {
{0,0,0},{0,1,0},{1,1,0.2},{1,2,0.2},{2,2,0.4},{2,1,0.4},{3,1,0.6},{3,0,0.6},
{2,0,0.8},{2,-1,0},{3,-1,0},{3,-2,-0.5},{4,-2,1},{4,-1,1.2},{5,-1,1.2},
{5,0,1.4},{6,0,1.4},{6,-1,1.6},{7,-1,1.6},{7,0,1.8},{8,0,1.8},{8,1,2}
};
Standard_Integer nPoints = sizeof(aCoords)/(sizeof(Standard_Real)*3);
TColgp_Array1OfPnt aPoints (1, nPoints); // points to analyze
TColStd_Array1OfReal aDens (1, nPoints); // dencities of points, weights
Standard_Integer aOneColorSection = nPoints/5;
Standard_Integer k = SCALE_FACTOR;
for (Standard_Integer i=0; i < nPoints; i++)
{
aPoints(i+1) = gp_Pnt (aCoords[i][0]*k, aCoords[i][1]*k, aCoords[i][2]*k);
aDens(i+1) = i*10+1;
// displaying points in different colors according to their weight
Quantity_NameOfColor aColorName = Quantity_NOC_BLUE1;
if (i <= 1*aOneColorSection) aColorName = Quantity_NOC_WHITESMOKE;
else if (i <= 2*aOneColorSection) aColorName = Quantity_NOC_ANTIQUEWHITE1;
else if (i <= 3*aOneColorSection) aColorName = Quantity_NOC_YELLOW;
else if (i <= 4*aOneColorSection) aColorName = Quantity_NOC_GREEN;
drawPoint(aPoints(i+1), Quantity_Color(aColorName));
}
GProp_PGProps aProps(aPoints, aDens);
gp_Pnt aBaryCentre; // geometric centre of shape that consists all the points
aBaryCentre = GProp_PGProps::Barycentre(aPoints);
//if (WAIT_A_SECOND) return;
Handle(AIS_Point) aPointIO = drawPoint(
aBaryCentre, MAIN_ELEMS_COLOR, Standard_False);
aPointIO->SetMarker(Aspect_TOM_STAR);
getAISContext()->Display(aPointIO);
// building a CUSTOM axis for calculation of inertial properties
gp_Ax1 anAxisForInertialProp(gp_Pnt(5*k,5*k,5*k), gp_Dir(0.2,0.8,0));
if (!GProps(aProps, anAxisForInertialProp, aText, "Mass")) return;
}
//================================================================
// Function : GProps_Presentation::sampleCurves
// Purpose :
//================================================================
void GProps_Presentation::sampleCurves()
{
ResetView();
SetViewCenter(61.308121161914, 17.674575084056);
SetViewScale(5.3585487153415);
setResultTitle("Global Linear Properties of Curves");
TCollection_AsciiString aText(
" TopoDS_Wire aWire;" EOL
" // initializing aWire" EOL
" // ..." EOL
" GProp_GProps aProps; // Global properties object" EOL
"" EOL
" // initializing Global properties object with linear properties of aWire" EOL
" BRepGProp::LinearProperties(aWire, aProps);" EOL);
// constructing a wire made of several edges
// initializing array of points mainly used for construction of anEdge2
Standard_Real aCoords[][3] = {
{0,0,0},{0,1,0},{1,1,0.2},{1,2,0.2},{2,2,0.4},{2,1,0.4},{3,1,0.6},{3,0,0.6},
{2,0,0.8},{2,-1,0},{3,-1,0},{3,-2,-0.5},{4,-2,1},{4,-1,1.2},{5,-1,1.2},
{5,0,1.4},{6,0,1.4},{6,-1,1.6},{7,-1,1.6},{7,0,1.8},{8,0,1.8},{8,1,2}
};
Standard_Integer nPoints = sizeof(aCoords)/(sizeof(Standard_Real)*3);
TColgp_Array1OfPnt aPoints (1, nPoints);
Standard_Integer k = SCALE_FACTOR;
for (Standard_Integer i=0; i < nPoints; i++)
aPoints(i+1) = gp_Pnt (aCoords[i][0]*k, aCoords[i][1]*k, aCoords[i][2]*k);
// edge 2 is a bezier curve that starts in edge1's end point
Handle(Geom_BezierCurve) aCurve = new Geom_BezierCurve(aPoints);
TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aCurve);
// edge 1 is a linear edge between 2 points
TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(gp_Pnt(-k, -k, 0), aCurve->StartPoint());
// edge 3 is a linear section as well
//TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge(aCurve->EndPoint(), gp_Pnt(1000, 300, 400));
// creating a wire that consists of the edges defined above
TopoDS_Wire aWire = BRepBuilderAPI_MakeWire (anEdge1, anEdge2);
drawShape(aWire);
GProp_GProps aProps; // Global properties object
// initializing Global properties object with linear properties of aWire
BRepGProp::LinearProperties(aWire, aProps);
// building a CUSTOM axis for calculation of inertial properties
gp_Ax1 anAxisForInertialProp(gp_Pnt(5*k,3*k,3*k), gp_Dir(0.1,0.2,0.7));
if (!GProps(aProps, anAxisForInertialProp, aText, "Length")) return;
}
//================================================================
// Function : GProps_Presentation::sampleSurfaces
// Purpose :
//================================================================
void GProps_Presentation::sampleSurfaces()
{
ResetView();
SetViewCenter(7.3480331410807, 5.9413176110886);
SetViewScale(6.0684301060407);
setResultTitle("Global Surface Properties of Shapes");
TCollection_AsciiString aText(
" TopoDS_Shell aShell;" EOL
" // initializing initial surface" EOL
" // ..." EOL
"" EOL
" GProp_GProps aProps; // Global properties object" EOL
"" EOL
" // initializing Global properties object with surface properties of aShell" EOL
" BRepGProp::SurfaceProperties(aShell, aProps);" EOL);
// constructing initial surface
Standard_Real aZCoords [] = {{-1},{0},{0},{1},{0},{-1},{-1},{0},{0},{-1.5},{-2.5},{0},{1},{-2},{-3},{0}};
TColStd_Array2OfReal aZPoints(1,4,1,4);
TColgp_Array2OfPnt aPnt(1,4,1,4);
Standard_Integer aColLength = aZPoints.ColLength();
Standard_Integer aRowLength = aZPoints.RowLength();
Standard_Integer aIndex = 0;
Standard_Integer k = SCALE_FACTOR;
for(Standard_Integer i = 0 ; i < aRowLength ; i++)
for(Standard_Integer j = 0; j < aColLength ; j++)
aZPoints(i+1,j+1) = (aZCoords[aIndex++] * k);
Standard_Real aXStep = 1.75*k, aYStep = 1.75*k;
Standard_Real aXBound = -3*k, aYBound = -2*k;
GeomAPI_PointsToBSplineSurface aPTBS(
aZPoints,aXBound,aXStep,aYBound,aYStep,3,8,GeomAbs_C3,k);
TopoDS_Shell aShell = BRepBuilderAPI_MakeShell(aPTBS.Surface());
drawShape(aShell);
GProp_GProps aProps; // Global properties object
// initializing Global properties object with surface properties of aShell
BRepGProp::SurfaceProperties(aShell, aProps);
// building a CUSTOM axis for calculation of inertial properties
gp_Ax1 anAxisForInertialProp(gp_Pnt(-3*k,-3*k,-3*k), gp_Dir(0.33,0.33,0.33));
if (!GProps(aProps, anAxisForInertialProp, aText, "Area")) return;
}
//================================================================
// Function : GProps_Presentation::sampleVolumes
// Purpose :
//================================================================
void GProps_Presentation::sampleVolumes()
{
ResetView();
SetViewCenter(83.572045344035, 38.188854653904);
SetViewScale(5.2570164985648);
setResultTitle("Global Volume Properties of Solids");
TCollection_AsciiString aText(
" TopoDS_Solid aSolid;" EOL
" // initializing the solid" EOL
" // ..." EOL
"" EOL
" GProp_GProps aProps; // Global properties object" EOL
"" EOL
" // initializing Global properties object with volume properties of aSolid" EOL
" BRepGProp::VolumeProperties(aSolid, aProps);" EOL);
// constructing initial surface
TopoDS_Shape aShape;
BRep_Builder aBuilder;
TCollection_AsciiString aFileName(GetDataDir());
aFileName += "\\shape1.brep";
Standard_Boolean Result = BRepTools::Read(aShape, aFileName.ToCString(), aBuilder);
if (!Result)
{
aFileName += " was not found. The sample can not be shown.";
setResultText(aFileName.ToCString());
return;
}
TopoDS_Solid aSolid;
TopExp_Explorer anExp(aShape, TopAbs_SOLID);
if (anExp.More())
aSolid = TopoDS::Solid(anExp.Current());
drawShape(aSolid);
GProp_GProps aProps; // Global properties object
// initializing Global properties object with volume properties of aSolid
BRepGProp::VolumeProperties(aSolid, aProps);
// building a CUSTOM axis for calculation of inertial properties
Standard_Integer k = SCALE_FACTOR;
gp_Ax1 anAxisForInertialProp(gp_Pnt(2.5*k,2.5*k,2.5*k), gp_Dir(0.2,0.8,0));
if (!GProps(aProps, anAxisForInertialProp, aText, "Volume")) return;
}
//================================================================
// Function : GProps_Presentation::sampleSystem
// Purpose :
//================================================================
void GProps_Presentation::sampleSystem()
{
ResetView();
SetViewCenter(107.10015835676, 76.510352154100);
SetViewScale(2.3110667631188);
setResultTitle("Global Properties of System of Shapes");
TCollection_AsciiString aText(
" TopoDS_Compound aShape;" EOL
" // initializing the shape" EOL
" // ..." EOL
"" EOL
" GProp_GProps aProps;" EOL
" GProp_GProps aLinearProps;" EOL
" GProp_GProps aSurfaceProps;" EOL
" GProp_GProps aVolumeProps;" EOL
"" EOL
" // creating a linear system, system that consists of all edges" EOL
" TopExp_Explorer anExp(aShape, TopAbs_EDGE, TopAbs_FACE);" EOL
" while (anExp.More())" EOL
" {" EOL
" GProp_GProps lp;" EOL
" BRepGProp::LinearProperties(anExp.Current(), lp);" EOL
" aLinearProps.Add(lp);" EOL
" anExp.Next();" EOL
" }" EOL
"" EOL
" // creating a surface system, system that consists of all faces" EOL
" anExp.Init(aShape, TopAbs_FACE, TopAbs_SHELL);" EOL
" while (anExp.More())" EOL
" {" EOL
" GProp_GProps sp;" EOL
" BRepGProp::SurfaceProperties(anExp.Current(), sp);" EOL
" aSurfaceProps.Add(sp);" EOL
" anExp.Next();" EOL
" }" EOL
"" EOL
" // creating a volume system, system that consists of all solids" EOL
" anExp.Init(aShape, TopAbs_SOLID);" EOL
" while (anExp.More())" EOL
" {" EOL
" GProp_GProps vp;" EOL
" BRepGProp::VolumeProperties(anExp.Current(), vp);" EOL
" aVolumeProps.Add(vp);" EOL
" anExp.Next();" EOL
" }" EOL
"" EOL
" Standard_Real aSurfaceDensity = 2;" EOL
" Standard_Real aVolumeDensity = 3;" EOL
" aProps.Add (aLinearProps); // density = 1.0" EOL
" aProps.Add (aSurfaceProps, aSurfaceDensity);" EOL
" aProps.Add (aVolumeProps, aVolumeDensity);" EOL);
// building a shape "space ship" that consists of a solid, 2 faces, and 2 edges
Standard_Real aCoords[][3] = {{3,-1,0},{1,0,0},{0,1,0},{0,7,0},{1,8,0},{3,9,0}};
Standard_Integer nPoints = sizeof(aCoords)/(sizeof(Standard_Real)*3);
TColgp_Array1OfPnt aPoints (1, nPoints);
Standard_Integer k = 15;
for (Standard_Integer i=0; i < nPoints; i++)
aPoints(i+1) = gp_Pnt (aCoords[i][0]*k, aCoords[i][1]*k, aCoords[i][2]*k);
Handle(Geom_BezierCurve) aCurve = new Geom_BezierCurve(aPoints);
gp_Ax1 anAxis(aPoints(1), gp_Dir(0,1,0));
Handle(Geom_SurfaceOfRevolution) aSurface = new Geom_SurfaceOfRevolution(aCurve, anAxis);
TopoDS_Solid aSolid = BRepBuilderAPI_MakeSolid(BRepBuilderAPI_MakeShell(aSurface));
TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(gp_Pnt(5*k, 2*k, 0), gp_Pnt(12*k, 7*k, 0));
TopoDS_Edge e2 = BRepBuilderAPI_MakeEdge(gp_Pnt(12*k, 7*k, 0), gp_Pnt(12*k, 11*k, 0));
TopoDS_Edge e3 = BRepBuilderAPI_MakeEdge(gp_Pnt(12*k, 11*k, 0), gp_Pnt(5*k, 5*k, 0));
TopoDS_Edge e4 = BRepBuilderAPI_MakeEdge(gp_Pnt(5*k, 5*k, 0), gp_Pnt(5*k, 2*k, 0));
TopoDS_Face aWing1 = BRepBuilderAPI_MakeFace(BRepBuilderAPI_MakeWire(e1, e2, e3, e4));
gp_Ax2d aMirrorAx(gp_Pnt2d(3*k, 0), gp_Dir2d(0,1));
gp_Trsf2d aTrsf2d;
aTrsf2d.SetMirror(aMirrorAx);
gp_Trsf aTrsf(aTrsf2d);
BRepBuilderAPI_Transform aBuilder(aWing1, aTrsf, Standard_True);
aBuilder.Perform(aWing1, Standard_True);
TopoDS_Face aWing2 = TopoDS::Face(aBuilder.Shape());
Handle(Geom_Circle) aCirc = new Geom_Circle(gp_Ax2(gp_Pnt(3*k, 11*k, 0), gp_Dir(0,-0.2,0.8)), (12-3)*k);
Handle(Geom_TrimmedCurve) aTrimCirc = new Geom_TrimmedCurve(aCirc, -PI/2, PI/2);
TopoDS_Edge aSpoiler = BRepBuilderAPI_MakeEdge(aTrimCirc);
TopoDS_Edge anArrow = BRepBuilderAPI_MakeEdge(gp_Pnt(3*k, 0, 0), gp_Pnt(3*k, -5*k, 0));
TopoDS_Compound aShape;
BRep_Builder aCompoundBuilder;
aCompoundBuilder.MakeCompound(aShape);
aCompoundBuilder.Add(aShape,aSolid);
aCompoundBuilder.Add(aShape,aWing1);
aCompoundBuilder.Add(aShape,aWing2);
aCompoundBuilder.Add(aShape,anArrow);
aCompoundBuilder.Add(aShape,aSpoiler);
drawShape(aSolid);
drawShape(aWing1);
drawShape(aWing2);
drawShape(anArrow, Quantity_NOC_GOLD);
drawShape(aSpoiler, Quantity_NOC_GOLD);
GProp_GProps aProps;
GProp_GProps aLinearProps;
GProp_GProps aSurfaceProps;
GProp_GProps aVolumeProps;
GProp_PrincipalProps aPrincipalProps;
// creating a linear system, system that consists of all edges
TopExp_Explorer anExp(aShape, TopAbs_EDGE, TopAbs_FACE);
while (anExp.More())
{
GProp_GProps lp;
BRepGProp::LinearProperties(anExp.Current(), lp);
aLinearProps.Add(lp);
anExp.Next();
}
// creating a surface system, system that consists of all faces
anExp.Init(aShape, TopAbs_FACE, TopAbs_SHELL);
while (anExp.More())
{
GProp_GProps sp;
BRepGProp::SurfaceProperties(anExp.Current(), sp);
aSurfaceProps.Add(sp);
anExp.Next();
}
// creating a volume system, system that consists of all solids
anExp.Init(aShape, TopAbs_SOLID);
while (anExp.More())
{
GProp_GProps vp;
BRepGProp::VolumeProperties(anExp.Current(), vp);
aVolumeProps.Add(vp);
anExp.Next();
}
Standard_Real aSurfaceDensity = 2;
Standard_Real aVolumeDensity = 3;
aProps.Add (aLinearProps); // density = 1.0
aProps.Add (aSurfaceProps, aSurfaceDensity);
aProps.Add (aVolumeProps, aVolumeDensity);
// Length of free edges
Standard_Real aEdgesLength = aLinearProps.Mass();
Standard_Real aFacesArea = aSurfaceProps.Mass();
Standard_Real aSolidsVolume = aVolumeProps.Mass();
// building a CUSTOM axis for calculation of inertial properties
gp_Ax1 anAxisForInertialProp(gp_Pnt(3.5*k,2*k,7*k), gp_Dir(-0.33,-0.33,-0.33));
if (!GProps(aProps, anAxisForInertialProp, aText, "Mass")) return;
aText = aText + EOL
" Length of free edges = " + TCollection_AsciiString(aEdgesLength) + EOL
" Area of free faces = " + TCollection_AsciiString(aFacesArea) + EOL
" Volume of solids = " + TCollection_AsciiString(aSolidsVolume);
setResultText(aText.ToCString());
}

View File

@ -1,45 +0,0 @@
// GProps_Presentation.h: interface for the GProps_Presentation class.
// Global Properties of Shapes
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_GProps_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_GProps_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class GProp_GProps;
class TCollection_AsciiString;
class GProps_Presentation : public OCCDemo_Presentation
{
public:
// Construction
GProps_Presentation();
public:
// Iteration on samples
virtual void DoSample();
// one phase of iterations
private:
// Sample functions
Standard_Boolean GProps(GProp_GProps& aProps, gp_Ax1&,
TCollection_AsciiString& theText, TCollection_AsciiString theMassStr);
void samplePoints();
void sampleCurves();
void sampleSurfaces();
void sampleVolumes();
void sampleSystem();
private:
// Array of pointers to sample functions
typedef void (GProps_Presentation::*PSampleFuncType)();
static const PSampleFuncType SampleFuncs[];
};
#endif // !defined(AFX_GProps_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,438 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="GeomConstraints"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/GeomConstraints.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Release/GeomConstraints.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/GeomConstraints.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/GeomConstraints.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/GeomConstraints.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Debug/GeomConstraints.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/GeomConstraints.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/GeomConstraints.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="GeomConstraints_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="GeomConstraints_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,889 +0,0 @@
// GeomConstraints_Presentation.cpp: implementation of the GeomConstraints_Presentation class.
// Construct curves and surfaces from constraints
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "GeomConstraints_Presentation.h"
#include <OCCDemo_Presentation.h>
#include <Standard_Stream.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Dir.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Ax2.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Lin.hxx>
#include <gp_Lin2d.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <Geom_Surface.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_Curve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <GeomPlate_Surface.hxx>
#include <GeomPlate_MakeApprox.hxx>
#include <GeomPlate_PointConstraint.hxx>
#include <GeomPlate_BuildPlateSurface.hxx>
#include <BRepFill_CurveConstraint.hxx>
#include <GeomFill_SimpleBound.hxx>
#include <GeomFill_ConstrainedFilling.hxx>
#include <GeomFill_BSplineCurves.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <GeomFill_BezierCurves.hxx>
#include <FairCurve_AnalysisCode.hxx>
#include <FairCurve_Batten.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <Precision.hxx>
#include <GeomAPI_PointsToBSpline.hxx>
#ifdef WNT
#define EOL "\r\n"
#else
#define EOL "\n"
#endif
// Initialization of global variable with an instance of this class
OCCDemo_Presentation* OCCDemo_Presentation::Current = new GeomConstraints_Presentation;
// Initialization of array of samples
const GeomConstraints_Presentation::PSampleFuncType GeomConstraints_Presentation::SampleFuncs[] =
{
&GeomConstraints_Presentation::sample1,
&GeomConstraints_Presentation::sample2,
&GeomConstraints_Presentation::sample3,
&GeomConstraints_Presentation::sample4,
&GeomConstraints_Presentation::sample5,
&GeomConstraints_Presentation::sample6
};
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
GeomConstraints_Presentation::GeomConstraints_Presentation()
{
myIndex = 0;
myNbSamples = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
setName ("GeomConstraints");
}
//=========================================================================================
// Sample execution
//=========================================================================================
void GeomConstraints_Presentation::DoSample()
{
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbSamples)
(this->*SampleFuncs[myIndex])();
}
//=========================================================================================
// Function creating Surface,BSPline,Bezier and 2dBSpline Curves
//=========================================================================================
static Handle(Geom_BSplineCurve) createBSplineCurve(const Standard_Integer nPoles,
const Standard_Real theCoords[][3])
{
TColgp_Array1OfPnt aCurvePoint (1, nPoles);
for (Standard_Integer i=0; i < nPoles; i++)
aCurvePoint(i+1) = gp_Pnt (theCoords[i][0]*100, theCoords[i][1]*100, theCoords[i][2]*100);
Standard_Integer MinDegree = 3;
Standard_Integer MaxDegree = 8;
return GeomAPI_PointsToBSpline (
aCurvePoint, MinDegree, MaxDegree, GeomAbs_C2, Precision::Confusion());
}
static Handle(Geom_BezierCurve) createBezierCurve(const Standard_Integer nPoles,
const Standard_Real theCoords[][3])
{
TColgp_Array1OfPnt aCurvePoint (1, nPoles);
for (Standard_Integer i=0; i < nPoles; i++)
aCurvePoint(i+1) = gp_Pnt (theCoords[i][0]*100, theCoords[i][1]*100, theCoords[i][2]*100);
Handle(Geom_BezierCurve) aBCurve = new Geom_BezierCurve(aCurvePoint);
return aBCurve;
}
static Handle(Geom2d_BSplineCurve) battenCurve(const Standard_Real& theAngle1,
const Standard_Real& theAngle2)
{
//define points
gp_Pnt2d aPoint1(-500,0);
gp_Pnt2d aPoint2(400,0);
//define height
Standard_Real Height = 5;
// method batten
FairCurve_Batten aBatten(aPoint1,aPoint2,Height);
//change parameters
aBatten.SetAngle1(theAngle1);
aBatten.SetAngle2(theAngle2);
FairCurve_AnalysisCode aCode;
Standard_Boolean aCompute = aBatten.Compute(aCode);
Handle(Geom2d_BSplineCurve) theCurve;
if(aCompute)
theCurve = aBatten.Curve();
return theCurve;
}
static Handle(Geom_Surface) createSurface(
const Standard_Integer endBound,
TColgp_Array1OfPnt& thePoint,
const Handle(Geom_Plane)& thePlane)
{
Standard_Integer Degree = 3;
Standard_Integer NbPtsOnCur = 10;
Standard_Integer NbIter = 3;
Standard_Integer Order = 0;
Standard_Integer MaxSeg=9;
Standard_Integer MaxDegree=5;
Standard_Real dmax,anApproxTol = 0.001, aConstrTol = Precision::Confusion();
// define object BuildPlateSurface
GeomPlate_BuildPlateSurface BPSurf(Degree,NbPtsOnCur,NbIter);
BPSurf.LoadInitSurface(thePlane);
for (Standard_Integer i = 1; i <= endBound ; i++)
{
// points constraint
Handle(GeomPlate_PointConstraint) PCont =
new GeomPlate_PointConstraint(thePoint.Value(i),Order, aConstrTol);
BPSurf.Add(PCont);
}
BPSurf.Perform();
// make PlateSurface
Handle(GeomPlate_Surface) PSurf;
Handle(Geom_Surface) aSurf;
if (BPSurf.IsDone())
{
PSurf = BPSurf.Surface();
// define parameter approximation
dmax = Max(0.01,10*BPSurf.G0Error());
// make approximation
GeomPlate_MakeApprox Mapp(PSurf,anApproxTol, MaxSeg,MaxDegree,dmax);
aSurf = Mapp.Surface();
}
return aSurf;
}
//////////////////////////////////////////////////////////////////////
// Sample functions
//////////////////////////////////////////////////////////////////////
//==========================================================================================
// Function : GeomConstraints_Presentation::sample1
// Purpose :
//==========================================================================================
void GeomConstraints_Presentation::sample1()
{
setResultTitle("Method Batten (Create 2dBSpline Curve)");
TCollection_AsciiString aText(
" // define points" EOL
" gp_Pnt2d aPoint1(-500,0);" EOL
" gp_Pnt2d aPoint2(400,0);" EOL EOL
" // define height" EOL
" Standard_Real Height = 5;" EOL EOL
" // construct algo" EOL
" FairCurve_Batten aBatten(aPoint1,aPoint2,Height);" EOL EOL
" // set constraint angles " EOL
" Standard_Real Angle1 = PI/4; " EOL
" Standard_Real Angle2 = PI/3; " EOL
" aBatten.SetAngle1(Angle1);" EOL
" aBatten.SetAngle2(Angle2);" EOL EOL
" FairCurve_AnalysisCode aCode;" EOL
" Standard_Boolean aCompute = aBatten.Compute(aCode);" EOL EOL
" // create BSpline Curve " EOL
" Handle(Geom2d_BSplineCurve) aCurve; " EOL
" if(aCompute) " EOL
" aCurve = aBatten.Curve();" EOL EOL
);
setResultText(aText.ToCString());
// define points
gp_Pnt2d aPoint1(-500,0);
gp_Pnt2d aPoint2(400,0);
Standard_Real Angle1=0,Angle2=0;
Standard_Real Angle3=PI/9,Angle4=PI/4,Angle5=PI/3;
Handle(Geom2d_BSplineCurve) aCurve = battenCurve(Angle1,Angle2);
Handle(Geom2d_BSplineCurve) aCurve1 = battenCurve(Angle3,Angle3);
Handle(Geom2d_BSplineCurve) aCurve2 = battenCurve(Angle4,Angle5);
// output
gp_Pnt aPoint(0,0,0);
gp_Pnt aPnt1(-500,0,0);
gp_Pnt aPnt2(400,0,0);
gp_Dir aDir(0,0,1);
gp_Ax2 anAx2(aPoint,aDir);
Handle(Geom2d_Line) aLine = new Geom2d_Line(aPoint1,gp_Dir2d(1,0));
Handle(Geom2d_TrimmedCurve) aTrimmedLine =
new Geom2d_TrimmedCurve(aLine,-250,aPoint1.Distance(aPoint2) + 250);
gp_Lin2d aLin(aPoint1,gp_Dir2d(1,0)) ;
Handle(Geom2d_Line) aLine10 = new Geom2d_Line(aLin.Rotated(aPoint1,PI/9));
Handle(Geom2d_Line) aLine11 = new Geom2d_Line(aLin.Rotated(aPoint1,PI/4));
Handle(Geom2d_TrimmedCurve) aTrimmedLine10 =
new Geom2d_TrimmedCurve(aLine10,0,300);
Handle(Geom2d_TrimmedCurve) aTrimmedLine11 =
new Geom2d_TrimmedCurve(aLine11,0,300);
gp_Lin2d aLin1(aPoint2,gp_Dir2d(-1,0)) ;
Handle(Geom2d_Line) aLine20 = new Geom2d_Line(aLin1.Rotated(aPoint2,-PI/9));
Handle(Geom2d_Line) aLine21 = new Geom2d_Line(aLin1.Rotated(aPoint2,-PI/3));
Handle(Geom2d_TrimmedCurve) aTrimmedLine20 =
new Geom2d_TrimmedCurve(aLine20,0,300);
Handle(Geom2d_TrimmedCurve) aTrimmedLine21 =
new Geom2d_TrimmedCurve(aLine21,0,300);
gp_Ax2d anAx2d_1(aPoint1,gp_Dir2d(1,0));
gp_Ax2d anAx2d_2(aPoint2,gp_Dir2d(-1,0));
Standard_Real Radius = 200;
Handle(Geom2d_Circle) aCircle1_1 = new
Geom2d_Circle(anAx2d_1,Radius);
Handle(Geom2d_Circle) aCircle2_1 = new
Geom2d_Circle(anAx2d_2,Radius);
Handle(Geom2d_TrimmedCurve) aTrimmedCircle1_1 =
new Geom2d_TrimmedCurve(aCircle1_1,0,PI/9);
Handle(Geom2d_TrimmedCurve) aTrimmedCircle1_2 =
new Geom2d_TrimmedCurve(aCircle2_1,-PI/9,0);
Handle(Geom2d_TrimmedCurve) aTrimmedCircle2_1 =
new Geom2d_TrimmedCurve(aCircle1_1,0,PI/4);
Handle(Geom2d_TrimmedCurve) aTrimmedCircle2_2 =
new Geom2d_TrimmedCurve(aCircle2_1,-PI/3,0);
Handle(AIS_InteractiveObject) aObjs1[10];
// output point
drawPoint(aPnt1);
drawPoint(aPnt2);
drawCurve(aTrimmedLine,Quantity_Color(Quantity_NOC_GRAY),Standard_True,anAx2);
// output first curve
aObjs1[0]=drawCurve(aCurve,Quantity_Color(Quantity_NOC_RED),Standard_True,anAx2);
if(WAIT_A_SECOND) return;
getAISContext()->Erase(aObjs1[0]);
// output second curve
aObjs1[1]=drawCurve(aTrimmedLine20,Quantity_Color(Quantity_NOC_GRAY),Standard_True,anAx2);
aObjs1[2]=drawCurve(aTrimmedLine10,Quantity_Color(Quantity_NOC_GRAY),Standard_True,anAx2);
aObjs1[3]=drawCurve(aTrimmedCircle1_1,Quantity_Color(Quantity_NOC_GRAY),Standard_True,anAx2);
aObjs1[4]=drawCurve(aTrimmedCircle1_2,Quantity_Color(Quantity_NOC_GRAY),Standard_True,anAx2);
aObjs1[5]=drawCurve(aCurve1,Quantity_Color(Quantity_NOC_RED),Standard_True,anAx2);
if(WAIT_A_SECOND) return;
getAISContext()->Erase(aObjs1[1],Standard_False);
getAISContext()->Erase(aObjs1[2],Standard_False);
getAISContext()->Erase(aObjs1[3],Standard_False);
getAISContext()->Erase(aObjs1[4],Standard_False);
getAISContext()->Erase(aObjs1[5],Standard_False);
// output third curve
drawCurve(aTrimmedLine21,Quantity_Color(Quantity_NOC_GRAY),Standard_True,anAx2);
drawCurve(aTrimmedLine11,Quantity_Color(Quantity_NOC_GRAY),Standard_True,anAx2);
aObjs1[6]=drawCurve(aTrimmedCircle2_1,Quantity_Color(Quantity_NOC_GRAY),Standard_True,anAx2);
aObjs1[7]=drawCurve(aTrimmedCircle2_2,Quantity_Color(Quantity_NOC_GRAY),Standard_True,anAx2);
aObjs1[8]=drawCurve(aCurve2,Quantity_Color(Quantity_NOC_RED),Standard_True,anAx2);
}
//==========================================================================================
// Function : GeomConstraints_Presentation::sample2
// Purpose :
//==========================================================================================
void GeomConstraints_Presentation::sample2()
{
setResultTitle("Create PlateSurface");
TCollection_AsciiString aText(
" // define points" EOL
" gp_Pnt P1(-300.,-300.,0.); " EOL
" gp_Pnt P2(300.,-300.,0.);" EOL
" gp_Pnt P3(300.,300.,0.);" EOL
" gp_Pnt P4(-300.,300.,0.); " EOL
" gp_Pnt P5(0.,0.,150.); " EOL
" gp_Pnt P6(-150.,-100.,30.);" EOL EOL
" // define parameters" EOL
" Standard_Integer Order = 0;" EOL
" Standard_Integer Tang = 0;" EOL
" Standard_Integer Degree = 3;" EOL
" Standard_Integer NbPtsOnCur = 10;" EOL
" Standard_Integer NbIter = 3;" EOL
" Standard_Integer MaxSeg=9;" EOL
" Standard_Integer MaxDegree=5;" EOL
" Standard_Real dmax,Tol = 0.001;" EOL EOL
" // create lines between points" EOL
" Handle(Geom_Line) aLine1,aLine2,Line3;" EOL
" aLine1 = new Geom_Line(P1,gp_Dir(1,0,0));" EOL
" aLine2 = new Geom_Line(P2,gp_Dir(0,1,0));" EOL
" aLine3 = new Geom_Line(P3,gp_Dir(-1,0,0));" EOL EOL
" // adapted curves" EOL
" Handle(GeomAdaptor_HCurve) aCurve1,aCurve2,aCurve3; " EOL
" aCurve1 = new GeomAdaptor_HCurve(aLine1); " EOL
" aCurve2 = new GeomAdaptor_HCurve(aLine2); " EOL
" aCurve3 = new GeomAdaptor_HCurve(aLine3); " EOL EOL
" // curves constraint" EOL
" Handle(BRepFill_CurveConstraint) aBFCC1,aBFCC2,aBFCC3; " EOL
" aBFCC1 = new BRepFill_CurveConstraint(aCurve1,Tang);" EOL
" aBFCC2 = new BRepFill_CurveConstraint(aCurve2,Tang);" EOL
" aBFCC3 = new BRepFill_CurveConstraint(aCurve3,Tang);" EOL EOL
" // point constraint" EOL
" Handle(GeomPlate_PointConstraint) PCont,PCont1; " EOL
" PCont = new GeomPlate_PointConstraint(P5,Order);" EOL
" PCont1 = new GeomPlate_PointConstraint(P6,Order);" EOL EOL
" // define object BuildPlateSurface" EOL
" GeomPlate_BuildPlateSurface BPSurf(Degree,NbPtsOnCur,NbIter);" EOL EOL
" // add all used constraints " EOL
" BPSurf.Add(PCont);" EOL
" BPSurf.Add(PCont1);" EOL
" BPSurf.Add(aBFCC1);" EOL
" BPSurf.Add(aBFCC2);" EOL
" BPSurf.Add(aBFCC3);" EOL EOL
" // build BuildPlateSurface" EOL
" BPSurf.Perform();" EOL EOL
" // make PlateSurface" EOL
" Handle(GeomPlate_Surface) PSurf = BPSurf.Surface();" EOL EOL
" // define parameter approximation" EOL
" dmax = Max(0.01,10*BPSurf.G0Error());" EOL EOL
" // make approximation" EOL
" GeomPlate_MakeApprox Mapp(PSurf,Tol,MaxSeg,MaxDegree,dmax);" EOL
" Handle(Geom_Surface) aSurf;" EOL
" aSurf = Mapp.Surface();" EOL EOL
);
setResultText(aText.ToCString());
// define points
gp_Pnt P1(-300.,-300.,0.);
gp_Pnt P2(300.,-300.,0.);
gp_Pnt P3(300.,300.,0.);
gp_Pnt P4(-300.,300.,0.);
gp_Pnt P5(0.,0.,150.);
gp_Pnt P6(-150.,-100.,30.);
// define parameters
Standard_Integer Order = 0;
Standard_Integer Tang = 0;
Standard_Integer Degree = 3;
Standard_Integer NbPtsOnCur = 10;
Standard_Integer NbIter = 3;
Standard_Integer MaxSeg=9;
Standard_Integer MaxDegree=5;
Standard_Real dmax,Tol = 0.001;
// make lines
Handle(Geom_Line) aLine1 = new Geom_Line(P1,gp_Dir(1,0,0));
Handle(Geom_Line) aLine2 = new Geom_Line(P2,gp_Dir(0,1,0));
Handle(Geom_Line) aLine3 = new Geom_Line(P3,gp_Dir(-1,0,0));
// trimmed lines
Handle(Geom_TrimmedCurve) aLine11 =
new Geom_TrimmedCurve(aLine1,0,P1.Distance(P2));
Handle(Geom_TrimmedCurve) aLine21 =
new Geom_TrimmedCurve(aLine2,0,P2.Distance(P3));
Handle(Geom_TrimmedCurve) aLine31 =
new Geom_TrimmedCurve(aLine3,0,P3.Distance(P4));
// adapted curves
Handle(GeomAdaptor_HCurve) aCurve1 = new GeomAdaptor_HCurve(aLine11);
Handle(GeomAdaptor_HCurve) aCurve2 = new GeomAdaptor_HCurve(aLine21);
Handle(GeomAdaptor_HCurve) aCurve3 = new GeomAdaptor_HCurve(aLine31);
// curves constraint
Handle(BRepFill_CurveConstraint) aBFCC1=
new BRepFill_CurveConstraint(aCurve1,Tang);
Handle(BRepFill_CurveConstraint) aBFCC2=
new BRepFill_CurveConstraint(aCurve2,Tang);
Handle(BRepFill_CurveConstraint) aBFCC3=
new BRepFill_CurveConstraint(aCurve3,Tang);
// points constraint
Handle(GeomPlate_PointConstraint) PCont =
new GeomPlate_PointConstraint(P5,Order);
Handle(GeomPlate_PointConstraint) PCont1 =
new GeomPlate_PointConstraint(P6,Order);
// define object BuildPlateSurface
GeomPlate_BuildPlateSurface BPSurf(Degree,NbPtsOnCur,NbIter);
// ======= 1 =========
BPSurf.Add(PCont);
BPSurf.Add(PCont1);
BPSurf.Add(aBFCC1);
BPSurf.Add(aBFCC2);
BPSurf.Add(aBFCC3);
BPSurf.Perform();
// make PlateSurface
Handle(GeomPlate_Surface) PSurf3 = BPSurf.Surface();
// define parameter approximation
dmax = Max(0.01,10*BPSurf.G0Error());
// make approximation
GeomPlate_MakeApprox Mapp3(PSurf3,Tol,MaxSeg,MaxDegree,dmax);
Handle(Geom_Surface) aSurf3 = Mapp3.Surface();
// ======= 2 =========
BPSurf.Init();
BPSurf.Add(PCont);
BPSurf.Add(aBFCC1);
BPSurf.Add(aBFCC2);
BPSurf.Add(aBFCC3);
BPSurf.Perform();
// make PlateSurface
Handle(GeomPlate_Surface) PSurf2 = BPSurf.Surface();
// make approximation
GeomPlate_MakeApprox Mapp2(PSurf2,Tol,MaxSeg,MaxDegree,dmax);
Handle(Geom_Surface) aSurf2 = Mapp2.Surface();
// ======= 3 =========
BPSurf.Init();
BPSurf.Add(aBFCC1);
BPSurf.Add(PCont);
BPSurf.Add(aBFCC3);
BPSurf.Perform();
// make PlateSurface
Handle(GeomPlate_Surface) PSurf1 = BPSurf.Surface();
// make approximation
GeomPlate_MakeApprox Mapp1(PSurf1,Tol,MaxSeg,MaxDegree,dmax);
Handle(Geom_Surface) aSurf1 = Mapp1.Surface();
// ===== output =====
// make and trimmed plane
Handle(Geom_Plane) aPlane = new Geom_Plane(P1,gp_Dir(0,0,1));
Handle(Geom_RectangularTrimmedSurface) aTrimmedPlane =
new Geom_RectangularTrimmedSurface(aPlane,-200,700,-200,700,Standard_True,Standard_True);
Handle(AIS_InteractiveObject) aObj;
drawCurve(aLine11);
drawCurve(aLine31);
if(WAIT_A_SECOND) return;
aObj=drawSurface(aTrimmedPlane);
if(WAIT_A_SECOND) return;
drawPoint(P5);
if(WAIT_A_SECOND) return;
getAISContext()->Erase(aObj,Standard_False);
aObj=drawSurface(aSurf1);
if(WAIT_A_SECOND) return;
drawCurve(aLine21);
if(WAIT_A_SECOND) return;
getAISContext()->Erase(aObj,Standard_False);
aObj=drawSurface(aSurf2);
if(WAIT_A_SECOND) return;
drawPoint(P6);
if(WAIT_A_SECOND) return;
getAISContext()->Erase(aObj,Standard_False);
drawSurface(aSurf3);
}
//==========================================================================================
// Function : GeomConstraints_Presentation::sample3
// Purpose :
//==========================================================================================
void GeomConstraints_Presentation::sample3()
{
setResultTitle("Surface from cloud of points");
TCollection_AsciiString aText(
" // define parameters for GeomPlate_BuildPlateSurface" EOL
" Standard_Integer Degree = 3;" EOL
" Standard_Integer NbPtsOnCur = 10;" EOL
" Standard_Integer NbIter = 3;" EOL
" Standard_Integer Order = 0;" EOL
" Standard_Integer MaxSeg=9;" EOL
" Standard_Integer MaxDegree=5;" EOL
" Standard_Real dmax,anApproxTol = 0.001;" EOL
" Standard_Real aConstrTol = Precision::Confusion();" EOL
"" EOL
" // number of points for GeomPlate_BuildPlateSurface" EOL
" Standard_Integer aSize;" EOL
"" EOL
" // define aSize ..." EOL
"" EOL
" // define array of points" EOL
" TColgp_Array1OfPnt aTColPnt(1,aSize);" EOL
"" EOL
" // initialize array " EOL
" // ..." EOL
"" EOL
" // define object BuildPlateSurface" EOL
" GeomPlate_BuildPlateSurface BPSurf(Degree,NbPtsOnCur,NbIter);" EOL
"" EOL
" for (Standard_Integer i = 1; i <= aSize ; i++)" EOL
" {" EOL
" // points constraint" EOL
" Handle(GeomPlate_PointConstraint) PCont = " EOL
" new GeomPlate_PointConstraint(aTColPnt.Value(i),Order,aConstrTol);" EOL
" BPSurf.Add(PCont);" EOL
" }" EOL
" " EOL
" // build BuildPlateSurface" EOL
" BPSurf.Perform();" EOL
"" EOL
" // make PlateSurface" EOL
" Handle(GeomPlate_Surface) PSurf;" EOL
" Handle(Geom_Surface) aSurf;" EOL
" " EOL
" if (BPSurf.IsDone())" EOL
" {" EOL
" PSurf = BPSurf.Surface();" EOL
""EOL
" // define parameter approximation" EOL
" dmax = Max(0.01,10*BPSurf.G0Error());" EOL
""EOL
" // make approximation" EOL
" GeomPlate_MakeApprox Mapp(PSurf,anApproxTol,MaxSeg,MaxDegree,dmax);" EOL
" aSurf = Mapp.Surface();" EOL
" }" EOL
);
setResultText(aText.ToCString());
TCollection_AsciiString aFileName(GetDataDir());
aFileName += "\\points.dat";
// open file
std::ifstream aFile;
aFile.open(aFileName.ToCString(), std::ios::failbit);
if(!aFile)
{
aFileName += " was not found. The sample can not be shown.";
setResultText(aFileName.ToCString());
return;
}
// define parameters
Standard_Integer aSize;
Standard_Integer aVal1 = 0;
Standard_Integer aVal2 = 0;
Standard_Integer aVal3 = 0;
aFile>>aSize;
// define array
TColgp_Array1OfPnt aTColPnt(1,aSize);
gp_Pnt aPoint(0,0,-2);
gp_Dir aDir(0,0,1);
Handle(Geom_Plane) aPlane =
new Geom_Plane(aPoint,aDir);
// read of file
for(Standard_Integer i =0; i < aSize; i++)
{
aFile>>aVal1;
aFile>>aVal2;
aFile>>aVal3;
aTColPnt(i+1) = gp_Pnt(aVal1*40, aVal2*40, aVal3*40);
}
aFile.close();
Handle(AIS_InteractiveObject) anIO,aNewIO;
for(Standard_Integer j = 1; j <= int(aSize / 20); j++)
{
// output points
for(Standard_Integer n = 20*(j-1) + 1; n <= 20*j; n++)
{
drawPoint(aTColPnt.Value(n));
}
if(WAIT_A_SECOND) return;
// create surface
Handle(Geom_Surface) aSurf = createSurface(n-1, aTColPnt,aPlane);
if (!aSurf.IsNull())
{
// output surface
aNewIO = drawSurface(aSurf, Quantity_NOC_LEMONCHIFFON3, Standard_False);
getAISContext()->Erase(anIO, Standard_False);
getAISContext()->Display(aNewIO);
anIO = aNewIO;
if(WAIT_A_SECOND) return;
}
}
}
//==========================================================================================
// Function : GeomConstraints_Presentation::sample4
// Purpose : Make Bezier Surface by Bezier Curves
//==========================================================================================
void GeomConstraints_Presentation::sample4()
{
setResultTitle("Fill surface between bezier curves");
TCollection_AsciiString aText(
" // define Bezier curves " EOL
" Handle(Geom_BezierCurve) aBezierCurve,aBezierCurve1,aBezierCurve2; " EOL
" // initializing bezier curves ..." EOL EOL
" // initializing object that creates a surface based on the given bezier curves" EOL
" GeomFill_BezierCurves aFBC1(aBezierCurve,aBezierCurve1,GeomFill_CurvedStyle);" EOL
" GeomFill_BezierCurves aFBC2(aBezierCurve,aBezierCurve1,aBezierCurve2,GeomFill_CoonsStyle);" EOL EOL
" // make Bezier Surface" EOL
" Handle(Geom_BezierSurface) aBezierSurf1 = aFBC1.Surface();" EOL
" Handle(Geom_BezierSurface) aBezierSurf2 = aFBC2.Surface();" EOL
);
setResultText(aText.ToCString());
Handle(AIS_InteractiveObject) aObjs[2];
// define arrays of points
Standard_Real aCoords[][3] = {{-6,0,-3},{-4,1,-3},{-2,-3,-3},{0,3,-1}};
Standard_Real aCoords1[][3] = {{-6,0,-3},{-4,2,-2},{-4,0,-1},{-6,0,1}};
Standard_Real aCoords2[][3] = {{-6,0,1},{-3,0,0},{2,3,1}};
// define lengths
Standard_Integer nPoles = sizeof(aCoords)/(sizeof(Standard_Real)*3);
Standard_Integer nPoles1 = sizeof(aCoords1)/(sizeof(Standard_Real)*3);
Standard_Integer nPoles2 = sizeof(aCoords2)/(sizeof(Standard_Real)*3);
// make Bezier curves
Handle(Geom_BezierCurve) aBezierCurve = createBezierCurve(nPoles,aCoords);
Handle(Geom_BezierCurve) aBezierCurve1 = createBezierCurve(nPoles1,aCoords1);
Handle(Geom_BezierCurve) aBezierCurve2 = createBezierCurve(nPoles2,aCoords2);
// initializing object that creates a surface based on the given bezier curves
GeomFill_BezierCurves aFBC1(aBezierCurve,aBezierCurve1,GeomFill_CurvedStyle);
GeomFill_BezierCurves aFBC2(aBezierCurve,aBezierCurve1,aBezierCurve2,GeomFill_CurvedStyle);
Handle(Geom_BezierSurface) aBezierSurf1 = aFBC1.Surface();
Handle(Geom_BezierSurface) aBezierSurf2 = aFBC2.Surface();
// output bezier curves and surface
drawCurve(aBezierCurve);
if(WAIT_A_LITTLE) return;
drawCurve(aBezierCurve1);
if(WAIT_A_SECOND) return;
// output surface 1
aObjs[0]=drawSurface(aBezierSurf1);
if(WAIT_A_SECOND) return;
getAISContext()->Erase(aObjs[0],Standard_False);
if(WAIT_A_LITTLE) return;
drawCurve(aBezierCurve2);
if(WAIT_A_SECOND) return;
// output surface 2
aObjs[1]=drawSurface(aBezierSurf2);
}
//==========================================================================================
// Function : GeomConstraints_Presentation::sample5
// Purpose : Make BSpline Surface by BSpline Curves
//==========================================================================================
void GeomConstraints_Presentation::sample5()
{
setResultTitle("Fill surface between bspline curves");
TCollection_AsciiString aText(
" // define bspline curves " EOL
" Handle (Geom_BSplineCurve) aBSCurve1,aBSCurve2,aBSCurve3,aBSCurve4; "EOL
" //initializing bspline curves ..." EOL EOL
" // initializing object that creates a surface based on the given bspline curves" EOL
" GeomFill_BSplineCurves aFBSC1(aBSCurve1,aBSCurve2,aBSCurve3,GeomFill_CurvedStyle);" EOL
" GeomFill_BSplineCurves aFBSC2(aBSCurve1,aBSCurve2,aBSCurve3,aBSCurve4,GeomFill_CurvedStyle);" EOL EOL
" // make BSpline Surface" EOL
" Handle(Geom_BSplineSurface) aBSplineSurf1 = aFBSC1.Surface();" EOL
" Handle(Geom_BSplineSurface) aBSplineSurf2 = aFBSC2.Surface();" EOL
);
setResultText(aText.ToCString());
Handle(AIS_InteractiveObject) aObjs[2];
// define arrays of points
Standard_Real aCoords[][3] = {{-4,0,-2},{-2,0,-4},{0,0,-1},{3,0,2}};
Standard_Real aCoords1[][3] = {{-4,0,-2},{-3,2,-1},{-2,2,1}};
Standard_Real aCoords2[][3] = {{-2,2,1},{-1,0,0},{0,1,2}};
Standard_Real aCoords3[][3] = {{0,1,2},{2,2,4},{3,0,2}};
// define lengths
Standard_Integer nPoles = sizeof(aCoords)/(sizeof(Standard_Real)*3);
Standard_Integer nPoles1 = sizeof(aCoords1)/(sizeof(Standard_Real)*3);
Standard_Integer nPoles2 = sizeof(aCoords2)/(sizeof(Standard_Real)*3);
Standard_Integer nPoles3 = sizeof(aCoords3)/(sizeof(Standard_Real)*3);
// make bspline curves
Handle(Geom_BSplineCurve) aBSCurve1 = createBSplineCurve(nPoles,aCoords);
Handle(Geom_BSplineCurve) aBSCurve2 = createBSplineCurve(nPoles1,aCoords1);
Handle(Geom_BSplineCurve) aBSCurve3 = createBSplineCurve(nPoles2,aCoords2);
Handle(Geom_BSplineCurve) aBSCurve4 = createBSplineCurve(nPoles3,aCoords3);
// initializing object that creates a surface based on the given bspline curves
GeomFill_BSplineCurves aFBSC1(aBSCurve1,aBSCurve2,aBSCurve3,GeomFill_CurvedStyle);
GeomFill_BSplineCurves aFBSC2(aBSCurve1,aBSCurve2,aBSCurve3,aBSCurve4,GeomFill_CurvedStyle);
Handle(Geom_BSplineSurface) aBSplineSurf1 = aFBSC1.Surface();
Handle(Geom_BSplineSurface) aBSplineSurf2 = aFBSC2.Surface();
// output
drawCurve(aBSCurve1);
if(WAIT_A_LITTLE) return;
drawCurve(aBSCurve2);
if(WAIT_A_LITTLE) return;
drawCurve(aBSCurve3);
if(WAIT_A_SECOND) return;
aObjs[0]=drawSurface(aBSplineSurf1);
if(WAIT_A_SECOND) return;
getAISContext()->Erase(aObjs[0],Standard_False);
if(WAIT_A_LITTLE) return;
drawCurve(aBSCurve4);
if(WAIT_A_SECOND) return;
aObjs[1]=drawSurface(aBSplineSurf2);
}
//==========================================================================================
// Function : GeomConstraints_Presentation::sample6
// Purpose : Create a surface based on the given bspline and bezier curves
//==========================================================================================
void GeomConstraints_Presentation::sample6()
{
setResultTitle("Constraint Filling");
TCollection_AsciiString aText(
" // define parameters" EOL
" Standard_Real Tol = 0.00001;" EOL
" Standard_Real dummy = 0.;" EOL
" Standard_Integer MaxDeg = 3;" EOL
" Standard_Integer MaxSeg = 8;" EOL EOL
" // make bspline curves " EOL
" Handle(Geom_BSplineCurve) aBSCurve,aBSCurve1; "EOL
" //initializing bspline curves ..." EOL EOL
" // make bezier curves " EOL
" Handle(Geom_BezierCurve) aBezierCurve; "EOL
" // initializing bezier curves ..." EOL EOL
" // adapted bspline and bezier curves" EOL
" Handle(GeomAdaptor_HCurve) adapHCurve = " EOL
" new GeomAdaptor_HCurve(aBSCurve);" EOL
" Handle(GeomAdaptor_HCurve) adapHCurve1 = " EOL
" new GeomAdaptor_HCurve(aBSCurve1);" EOL
" Handle(GeomAdaptor_HCurve) adapHCurve2 = " EOL
" new GeomAdaptor_HCurve(aBezierCurve);" EOL EOL
" // simple bound" EOL
" Handle(GeomFill_SimpleBound) myBoundary = " EOL
" new GeomFill_SimpleBound(adapHCurve,Tol,dummy); " EOL
" Handle(GeomFill_SimpleBound) myBoundary1 = " EOL
" new GeomFill_SimpleBound(adapHCurve1,Tol,dummy); " EOL
" Handle(GeomFill_SimpleBound) myBoundary2 = " EOL
" new GeomFill_SimpleBound(adapHCurve2,Tol,dummy); " EOL EOL
" // define and initilization ConstrainedFilling" EOL
" GeomFill_ConstrainedFilling aFCF(MaxDeg,MaxSeg);" EOL EOL
" aFCF.Init(myBoundary,myBoundary1,myBoundary2); " EOL EOL
" // make BSpline Surface" EOL
" Handle(Geom_BSplineSurface) aBSplineSurf; "EOL
" aBSplineSurface = aFCF.Surface();" EOL EOL
);
setResultText(aText.ToCString());
// define arrays of points
Standard_Real aCoords[][3] = {{-5,2,-2},{-3,1,-4},{0,0,-1},{3,0,2}};
Standard_Real aCoords1[][3] = {{-5,2,-2},{-3,4,-1},{-2,3,1}};
Standard_Real aCoords2[][3] = {{-2,3,1},{-1,3,0},{2,1,0},{3,0,2}};
Standard_Integer nPoles = sizeof(aCoords)/(sizeof(Standard_Real)*3);
Standard_Integer nPoles1 = sizeof(aCoords1)/(sizeof(Standard_Real)*3);
Standard_Integer nPoles2 = sizeof(aCoords2)/(sizeof(Standard_Real)*3);
// define parameters
Standard_Real Tol = 0.00001;
Standard_Real dummy = 0.;
Standard_Integer MaxDeg = 3;
Standard_Integer MaxSeg = 8;
// The adapted curves is created in the following way:
Handle(Geom_Curve) aBSCurve = createBSplineCurve(nPoles,aCoords);
Handle(Geom_Curve) aBSCurve1 = createBSplineCurve(nPoles1,aCoords1);
Handle(Geom_BezierCurve) aBezierCurve = createBezierCurve(nPoles2,aCoords2);
// adapted BSpline and Bezier curves
Handle(GeomAdaptor_HCurve) adapHCurve = new GeomAdaptor_HCurve(aBSCurve);
Handle(GeomAdaptor_HCurve) adapHCurve1 = new GeomAdaptor_HCurve(aBSCurve1);
Handle(GeomAdaptor_HCurve) adapHCurve2 = new GeomAdaptor_HCurve(aBezierCurve);
// simple bound
Handle(GeomFill_SimpleBound) myBoundary =
new GeomFill_SimpleBound(adapHCurve,Tol,dummy);
Handle(GeomFill_SimpleBound) myBoundary1 =
new GeomFill_SimpleBound(adapHCurve1,Tol,dummy);
Handle(GeomFill_SimpleBound) myBoundary2 =
new GeomFill_SimpleBound(adapHCurve2,Tol,dummy);
// define and initilization ConstrainedFilling
GeomFill_ConstrainedFilling aFCF(MaxDeg,MaxSeg);
aFCF.Init(myBoundary,myBoundary1,myBoundary2);
// make BSpline Surface
Handle(Geom_BSplineSurface) aBSplineSurf = aFCF.Surface();
// output curves and surface
drawCurve(aBSCurve);
if(WAIT_A_LITTLE) return;
drawCurve(aBSCurve1);
if(WAIT_A_LITTLE) return;
drawCurve(aBezierCurve);
if(WAIT_A_SECOND) return;
drawSurface(aBSplineSurf);
}

View File

@ -1,41 +0,0 @@
// GeomConstraints_Presentation.h: interface for the GeomConstraints_Presentation class.
// Construct curves and surfaces from constraints
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_GeomConstraints_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_GeomConstraints_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class GeomConstraints_Presentation : public OCCDemo_Presentation
{
public:
// Construction
GeomConstraints_Presentation();
public:
// Iteration on samples
virtual void DoSample();
// one phase of iterations
private:
// Sample functions
void sample1();
void sample2();
void sample3();
void sample4();
void sample5();
void sample6();
private:
// Array of pointers to sample functions
typedef void (GeomConstraints_Presentation::*PSampleFuncType)();
static const PSampleFuncType SampleFuncs[];
};
#endif

View File

@ -1,450 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Glue"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/Glue.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
BrowseInformation="1"
BrowseInformationFile=".\../Release/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Release/Glue.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/Glue.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/Glue.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/Glue.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
BrowseInformation="1"
BrowseInformationFile=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBO.lib TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib"
OutputFile=".\../Debug/Glue.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/Glue.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/Glue.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="Glue_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="Glue_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,395 +0,0 @@
// Glue_Presentation.cpp: implementation of the Glue_Presentation class.
// Glue two solid shapes with contiguous faces
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Glue_Presentation.h"
#include <OCCDemoDoc.h>
#include <TopoDS_Solid.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepFeat_Gluer.hxx>
#include <TopExp.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Geom_Circle.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
// Initialization of global variable with an instance of this class
OCCDemo_Presentation* OCCDemo_Presentation::Current = new Glue_Presentation;
// Initialization of array of samples
const Glue_Presentation::PSampleFuncType Glue_Presentation::SampleFuncs[] =
{
//&Glue_Presentation::sampleBoxes1,
&Glue_Presentation::sampleBoxes,
&Glue_Presentation::sampleCylinder,
//&Glue_Presentation::sampleMoreBoxes
};
#ifdef WNT
#define EOL "\r\n"
#else
#define EOL "\n"
#endif
#define RESULT_SHAPE_COLOR Quantity_NOC_ORANGE
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Glue_Presentation::Glue_Presentation()
{
myNbSamples = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
setName ("Glue shapes");
}
//////////////////////////////////////////////////////////////////////
// Sample execution
//////////////////////////////////////////////////////////////////////
void Glue_Presentation::DoSample()
{
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbSamples)
(this->*SampleFuncs[myIndex])();
}
//////////////////////////////////////////////////////////////////////
// Sample functions
//////////////////////////////////////////////////////////////////////
//================================================================
// Function : Glue_Presentation::sampleBoxes
// Purpose :
//================================================================
void Glue_Presentation::sampleBoxes()
{
setResultTitle("Glue two solids");
setResultText(
" // Create shapes" EOL
" TopoDS_Solid aShape1;" EOL
" TopoDS_Solid aShape2; " EOL
" //aShape1 = ..." EOL
" //aShape2 = ..." EOL
"" EOL
" // Define same domain faces on aShape1 and aShape2" EOL
" TopoDS_Face aFace1;" EOL
" TopoDS_Face aFace2;" EOL
" //aFace1 = ..." EOL
" //aFace2 = ..." EOL
"" EOL
" // Define same domain edges on aShape1 and aShape2" EOL
" TopoDS_Edge aEdge1;" EOL
" TopoDS_Edge aEdge2;" EOL
" //aEdge1 = ..." EOL
" //aEdge2 = ..." EOL
"" EOL
" BRepFeat_Gluer aGluer(aShape2, aShape1);" EOL
" aGluer.Bind(aFace2, aFace1);" EOL
" aGluer.Bind(aEdge2, aEdge1);" EOL
" aGluer.Build();" EOL
"" EOL
" TopoDS_Shape aGluedShape;" EOL
" if (aGluer.IsDone())" EOL
" aGluedShape = aGluer;" EOL);
Standard_Real a = 10.0;
TopoDS_Solid aShape1 = BRepPrimAPI_MakeBox(a,a,a);
TopoDS_Solid aShape2 = BRepPrimAPI_MakeBox(gp_Pnt(a,a/2,a/4),a/2,a/2,a/2);
TopTools_IndexedMapOfShape aShape1Faces, aShape2Faces;
TopTools_IndexedMapOfShape aShape1Edges, aShape2Edges;
TopExp::MapShapes(aShape1, TopAbs_FACE, aShape1Faces);
TopExp::MapShapes(aShape2, TopAbs_FACE, aShape2Faces);
TopExp::MapShapes(aShape1, TopAbs_EDGE, aShape1Edges);
TopExp::MapShapes(aShape2, TopAbs_EDGE, aShape2Edges);
Standard_Integer fi1 = 2, fi2 = 1, ei1 = 7, ei2 = 3;
TopoDS_Face aFace1 = TopoDS::Face(aShape1Faces(fi1));
TopoDS_Face aFace2 = TopoDS::Face(aShape2Faces(fi2));
TopoDS_Edge aEdge1 = TopoDS::Edge(aShape1Edges(ei1));
TopoDS_Edge aEdge2 = TopoDS::Edge(aShape2Edges(ei2));
BRepFeat_Gluer aGluer(aShape2, aShape1);
aGluer.Bind(aFace2, aFace1);
aGluer.Bind(aEdge2, aEdge1);
aGluer.Build();
TopoDS_Shape aGluedShape;
if (aGluer.IsDone())
aGluedShape = aGluer;
TopTools_ListOfShape aEdges1,aEdges2,aFaces1,aFaces2;
aEdges1.Append(aEdge1); aEdges2.Append(aEdge2);
aFaces1.Append(aFace1); aFaces2.Append(aFace2);
displayShapesFaces(aShape1,aShape2,aGluedShape,aFaces1,aFaces2,aEdges1,aEdges2);
}
//================================================================
// Function : Glue_Presentation::sampleCylinder
// Purpose :
//================================================================
void Glue_Presentation::sampleCylinder()
{
setResultTitle("Glue two solids");
setResultText(
" // Create shapes" EOL
" TopoDS_Solid aShape1;" EOL
" TopoDS_Solid aShape2; " EOL
" //aShape1 = ..." EOL
" //aShape2 = ..." EOL
"" EOL
" // Define same domain faces on aShape1 and aShape2" EOL
" TopoDS_Face aFace1;" EOL
" TopoDS_Face aFace2;" EOL
" //aFace1 = ..." EOL
" //aFace2 = ..." EOL
"" EOL
" BRepFeat_Gluer aGluer(aShape2, aShape1);" EOL
" aGluer.Bind(aFace2, aFace1);" EOL
" aGluer.Build();" EOL
"" EOL
" TopoDS_Shape aGluedShape;" EOL
" if (aGluer.IsDone())" EOL
" aGluedShape = aGluer;" EOL);
TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(gp_Pnt(0,0,0),gp_Pnt(5,0,0));
TopoDS_Edge e3 = BRepBuilderAPI_MakeEdge(gp_Pnt(19,0,0),gp_Pnt(24,0,0));
TopoDS_Edge e4 = BRepBuilderAPI_MakeEdge(gp_Pnt(24,0,0),gp_Pnt(24,15,0));
TopoDS_Edge e5 = BRepBuilderAPI_MakeEdge(gp_Pnt(24,15,0),gp_Pnt(0,15,0));
TopoDS_Edge e6 = BRepBuilderAPI_MakeEdge(gp_Pnt(0,15,0),gp_Pnt(0,0,0));
Handle(Geom_Circle) e2C = new Geom_Circle(gp_Ax2(gp_Pnt(12,0,0), gp_Dir(0,0,1)), 7);
e2C->Rotate(gp_Ax1(gp_Pnt(12,0,0),gp_Dir(0,0,1)),PI);
Handle(Geom_TrimmedCurve) e2A = new Geom_TrimmedCurve(e2C, PI, 2*PI);
TopoDS_Edge e2 = BRepBuilderAPI_MakeEdge(e2A);
BRepBuilderAPI_MakeWire wireMaker(e1,e2,e3,e4);
wireMaker.Add(e5);
wireMaker.Add(e6);
TopoDS_Face aFace = BRepBuilderAPI_MakeFace(wireMaker);
TopoDS_Shape aShape1 = BRepPrimAPI_MakePrism(aFace, gp_Vec(gp_Pnt(0,0,0),gp_Pnt(0,0,30)));
TopoDS_Shape aShape2 = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(12,0,-10),gp_Dir(0,0,1), gp_Dir(-0.5,-0.5,0)), 7, 50);
TopTools_IndexedMapOfShape aShape1Faces, aShape2Faces;
TopExp::MapShapes(aShape1, TopAbs_FACE, aShape1Faces);
TopExp::MapShapes(aShape2, TopAbs_FACE, aShape2Faces);
Standard_Integer fi1 = 2;
Standard_Integer fi2 = 1;
TopoDS_Face aFace1 = TopoDS::Face(aShape1Faces(fi1));
TopoDS_Face aFace2 = TopoDS::Face(aShape2Faces(fi2));
BRepFeat_Gluer aGluer(aShape1, aShape2);
aGluer.Bind(aFace1, aFace2);
aGluer.Build();
TopoDS_Shape aGluedShape;
if (aGluer.IsDone())
aGluedShape = aGluer;
TopTools_ListOfShape aEdges1,aEdges2,aFaces1,aFaces2;
aFaces1.Append(aFace1); aFaces2.Append(aFace2);
displayShapesFaces(aShape1, aShape2, aGluedShape, aFaces1, aFaces2, aEdges1, aEdges2);
}
//================================================================
// Function : Glue_Presentation::sampleMoreBoxes
// Purpose :
//================================================================
void Glue_Presentation::sampleMoreBoxes()
{
setResultTitle("Glue two solids");
setResultText(
" // Create shapes" EOL
" TopoDS_Solid aShape1;" EOL
" TopoDS_Solid aShape2; " EOL
" //aShape1 = ..." EOL
" //aShape2 = ..." EOL
"" EOL
" // Define same domain faces on aShape1 and aShape2" EOL
" TopoDS_Face aFace11,aFace12,aFace13;" EOL
" TopoDS_Face aFace21,aFace22,aFace23;" EOL
" //aFace11 = ..." EOL
" //aFace21 = ..." EOL
"" EOL
" // Define same domain edges on aShape1 and aShape2" EOL
" TopoDS_Edge aEdge11,aEdge12,aEdge13;" EOL
" TopoDS_Edge aEdge21,aEdge22,aEdge23;" EOL
" //aEdge11 = ..." EOL
" //aEdge21 = ..." EOL
"" EOL
" BRepFeat_Gluer aGluer(aShape2, aShape1);" EOL
" aGluer.Bind(aFace21, aFace11);" EOL
" aGluer.Bind(aFace22, aFace12);" EOL
" aGluer.Bind(aFace23, aFace13);" EOL
" aGluer.Bind(aEdge21, aEdge11);" EOL
" aGluer.Bind(aEdge22, aEdge12);" EOL
" aGluer.Bind(aEdge23, aEdge13);" EOL
" aGluer.Build();" EOL
"" EOL
" TopoDS_Shape aGluedShape;" EOL
" if (aGluer.IsDone())" EOL
" aGluedShape = aGluer;" EOL);
TopoDS_Shape aShape1;
TopoDS_Shape aShape2;
Standard_Real a = 10.0;
TopoDS_Solid aBox1 = BRepPrimAPI_MakeBox(a,a,a);
TopoDS_Solid aBox2 = BRepPrimAPI_MakeBox(gp_Pnt(a/2,a/2,a/2),a,a,a);
BRepAlgoAPI_Cut aCutter(aBox1,aBox2);
aCutter.Build();
if (aCutter.IsDone())
aShape1 = aCutter.Shape();
aShape2 = aBox2;
TopTools_IndexedMapOfShape aShape1Faces, aShape2Faces;
TopTools_IndexedMapOfShape aShape1Edges, aShape2Edges;
TopExp::MapShapes(aShape1, TopAbs_FACE, aShape1Faces);
TopExp::MapShapes(aShape2, TopAbs_FACE, aShape2Faces);
TopExp::MapShapes(aShape1, TopAbs_EDGE, aShape1Edges);
TopExp::MapShapes(aShape2, TopAbs_EDGE, aShape2Edges);
Standard_Integer ei11 = 15, ei12 = 14, ei13 = 18;
Standard_Integer ei21 = 1, ei22 = 9, ei23 = 4;
Standard_Integer fi11 = 9, fi12 = 4, fi13 = 6;
Standard_Integer fi21 = 1, fi22 = 3, fi23 = 5;
TopoDS_Face f11 = TopoDS::Face(aShape1Faces(fi11));
TopoDS_Face f12 = TopoDS::Face(aShape1Faces(fi12));
TopoDS_Face f13 = TopoDS::Face(aShape1Faces(fi13));
TopoDS_Edge e11 = TopoDS::Edge(aShape1Edges(ei11));
TopoDS_Edge e12 = TopoDS::Edge(aShape1Edges(ei12));
TopoDS_Edge e13 = TopoDS::Edge(aShape1Edges(ei13));
TopoDS_Face f21 = TopoDS::Face(aShape2Faces(fi21));
TopoDS_Face f22 = TopoDS::Face(aShape2Faces(fi22));
TopoDS_Face f23 = TopoDS::Face(aShape2Faces(fi23));
TopoDS_Edge e21 = TopoDS::Edge(aShape2Edges(ei21));
TopoDS_Edge e22 = TopoDS::Edge(aShape2Edges(ei22));
TopoDS_Edge e23 = TopoDS::Edge(aShape2Edges(ei23));
BRepFeat_Gluer aGluer(aShape1, aShape2);
aGluer.Bind(e11, e21);
aGluer.Bind(e12, e22);
aGluer.Bind(e13, e23);
aGluer.Bind(f11, f21);
aGluer.Bind(f12, f22);
aGluer.Bind(f13, f23);
aGluer.Build();
TopoDS_Shape aGluedShape;
if (aGluer.IsDone())
aGluedShape = aGluer;
TopTools_ListOfShape aEdges1,aEdges2,aFaces1,aFaces2;
aEdges1.Append(e11); aEdges1.Append(e12);
aEdges1.Append(e13); aEdges2.Append(e21);
aEdges2.Append(e22); aEdges2.Append(e23);
aFaces1.Append(f11); aFaces1.Append(f12);
aFaces1.Append(f13); aFaces2.Append(f21);
aFaces2.Append(f22); aFaces2.Append(f23);
displayShapesFaces(aShape1,aShape2,aGluedShape,aFaces1,aFaces2,aEdges1,aEdges2);
}
//================================================================
// Function : Glue_Presentation::drawShapeWf
// Purpose : display a shape in wire frame mode
//================================================================
Standard_Boolean Glue_Presentation::drawShapeWf(TopoDS_Shape& aShape,
Handle(AIS_InteractiveObject)& io)
{
io = drawShape(aShape, Graphic3d_NOM_BRASS, Standard_False);
getAISContext()->SetDisplayMode(io, AIS_WireFrame, Standard_False);
getAISContext()->Display(io);
return !WAIT_A_LITTLE;
}
//================================================================
// Function : Glue_Presentation::drawShapeSh
// Purpose : display a shape in shaded mode
//================================================================
Standard_Boolean Glue_Presentation::drawShapeSh(TopoDS_Shape& aShape,
Handle(AIS_InteractiveObject)& io)
{
io = drawShape(aShape, Graphic3d_NOM_BRASS, Standard_False);
getAISContext()->SetDisplayMode(io, AIS_Shaded, Standard_False);
getAISContext()->Display(io, Standard_False);
COCCDemoDoc::Fit();
return !WAIT_A_LITTLE;
}
//================================================================
// Function : Glue_Presentation::displayShapesFaces
// Purpose : displays shapes, same domain faces and edges if given
//================================================================
Standard_Boolean Glue_Presentation::displayShapesFaces(TopoDS_Shape& aShape1,
TopoDS_Shape& aShape2,
TopoDS_Shape& aGluedShape,
TopTools_ListOfShape& aFaces1,
TopTools_ListOfShape& aFaces2,
TopTools_ListOfShape& aEdges1,
TopTools_ListOfShape& aEdges2)
{
Handle(AIS_Shape) io1,io2,io3,io4,io5,io6;
if (!drawShapeSh(aShape1, io1)) return Standard_False;
if (!drawShapeSh(aShape2, io2)) return Standard_False;
getAISContext()->SetDisplayMode(io1, AIS_WireFrame, Standard_False);
getAISContext()->SetDisplayMode(io2, AIS_WireFrame);
if (WAIT_A_LITTLE) return Standard_False;
TopTools_ListIteratorOfListOfShape it1,it2;
for (it1.Initialize(aEdges1),it2.Initialize(aEdges2);
it1.More() && it2.More();
it1.Next(),it2.Next())
{
if (!drawShapeWf(it2.Value(), io6)) return Standard_False;
getAISContext()->Erase(io6);
if (WAIT_A_LITTLE) return Standard_False;
if (!drawShapeWf(it1.Value(), io6)) return Standard_False;
getAISContext()->Erase(io6);
if (WAIT_A_LITTLE) return Standard_False;
}
for (it1.Initialize(aFaces1),it2.Initialize(aFaces2);
it1.More() && it2.More();
it1.Next(),it2.Next())
{
if (!drawShapeSh(it2.Value(), io6)) return Standard_False;
getAISContext()->Erase(io6);
if (WAIT_A_LITTLE) return Standard_False;
if (!drawShapeSh(it1.Value(), io6)) return Standard_False;
getAISContext()->Erase(io6);
if (WAIT_A_LITTLE) return Standard_False;
}
getAISContext()->Erase(io1, Standard_False);
getAISContext()->Erase(io2, Standard_False);
io1 = drawShape(aGluedShape, RESULT_SHAPE_COLOR, Standard_False);
getAISContext()->SetDisplayMode(io1, AIS_WireFrame, Standard_False);
getAISContext()->Display(io1);
if (WAIT_A_LITTLE) return Standard_False;
getAISContext()->SetDisplayMode(io1, AIS_Shaded);
return Standard_True;
}

View File

@ -1,56 +0,0 @@
// Glue_Presentation.h: interface for the Glue_Presentation class.
// Glue two solid shapes with contiguous faces
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_Glue_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_Glue_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class GProp_Glue;
class TCollection_AsciiString;
class TopoDS_Shape;
class AIS_InteractiveObject;
#include <TopTools_ListOfShape.hxx>
class Glue_Presentation : public OCCDemo_Presentation
{
public:
// Construction
Glue_Presentation();
public:
// Iteration on samples
virtual void DoSample();
// one phase of iterations
private:
// Sample functions
// displays the shapes to be glued, given same domain faces and edges
// and at last - the glued shape
Standard_Boolean displayShapesFaces(TopoDS_Shape&, TopoDS_Shape&,
TopoDS_Shape&, TopTools_ListOfShape&, TopTools_ListOfShape&,
TopTools_ListOfShape&, TopTools_ListOfShape&);
// display a given shape in wire frame mode
Standard_Boolean drawShapeWf(TopoDS_Shape&,Handle(AIS_InteractiveObject)&);
// display a given shape in shaded mode
Standard_Boolean drawShapeSh(TopoDS_Shape&,Handle(AIS_InteractiveObject)&);
void sampleBoxes();
void sampleCylinder();
void sampleMoreBoxes();
private:
// Array of pointers to sample functions
typedef void (Glue_Presentation::*PSampleFuncType)();
static const PSampleFuncType SampleFuncs[];
};
#endif // !defined(AFX_Glue_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,450 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="HLR"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/HLR.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
BrowseInformation="1"
BrowseInformationFile=".\../Release/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKMesh.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Release/HLR.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/HLR.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/HLR.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/HLR.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
BrowseInformation="1"
BrowseInformationFile=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKMesh.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Debug/HLR.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/HLR.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/HLR.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="HLR_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="HLR_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,525 +0,0 @@
// HLR_Presentation.cpp: implementation of the HLR_Presentation class.
// Hidden lines removal
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "HLR_Presentation.h"
#include <Geom_ToroidalSurface.hxx>
#include <HLRBRep_Algo.hxx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <HLRAlgo_Projector.hxx>
#include <Prs3d_Projector.hxx>
#include <TopoDS_Shell.hxx>
#include <HLRBRep_HLRToShape.hxx>
#include <HLRBRep_PolyAlgo.hxx>
#include <HLRBRep_PolyHLRToShape.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <BRepTools.hxx>
#include <BRepMesh.hxx>
#include <BRep_Builder.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <TopoDS_Solid.hxx>
// Initialization of global variable with an instance of this class
OCCDemo_Presentation* OCCDemo_Presentation::Current = new HLR_Presentation;
// Initialization of array of samples
const HLR_Presentation::PSampleFuncType HLR_Presentation::SampleFuncs[] =
{
&HLR_Presentation::sampleCylinder,
&HLR_Presentation::sampleTorus,
&HLR_Presentation::sampleBrepShape2,
&HLR_Presentation::sampleBrepShape1
};
#ifdef WNT
#define EOL "\r\n"
#else
#define EOL "\n"
#endif
#define SharpEdge_COLOR Quantity_NOC_CYAN1
#define SmoothEdge_COLOR Quantity_NOC_RED
#define SewnEdge_COLOR Quantity_NOC_ORANGE1
#define OutLine_COLOR Quantity_NOC_MAGENTA1
#define IsoLine_COLOR Quantity_NOC_YELLOW
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
HLR_Presentation::HLR_Presentation()
{
FitMode = true;
myNbSamples = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
setName ("Hidden Lines Removal");
}
//////////////////////////////////////////////////////////////////////
// Sample execution
//////////////////////////////////////////////////////////////////////
void HLR_Presentation::DoSample()
{
getAISContext()->EraseAll();
setResultTitle("Hidden Lines Removal");
if (myIndex >=0 && myIndex < myNbSamples)
(this->*SampleFuncs[myIndex])();
}
//================================================================
// Function : Projector
// Purpose : returns Prs3d_Projector object created corresponding
// to the current view parameters
//================================================================
Handle(Prs3d_Projector) HLR_Presentation::Projector(gp_Trsf& theTrsf)
{
// retrieve view parameters for creation of Prs3d_Projector object
getViewer()->InitActiveViews();
Handle(V3d_View) aView = getViewer()->ActiveView();
Standard_Real aProjVecX, aProjVecY, aProjVecZ;
aView->Proj(aProjVecX, aProjVecY, aProjVecZ);
Standard_Real aUpX, aUpY, aUpZ;
aView->Up(aUpX, aUpY, aUpZ);
Standard_Real aPntX = 0.0, aPntY = 0.0, aPntZ = 0.0;
// create a projector object
Handle(Prs3d_Projector) aProjector = new Prs3d_Projector(Standard_False, 0.0,
aProjVecX, aProjVecY, aProjVecZ, aPntX, aPntY, aPntZ, aUpX, aUpY, aUpZ);
gp_Pnt At (aPntX,aPntY,aPntZ);
gp_Dir Zpers (aProjVecX,aProjVecY,aProjVecZ);
gp_Dir Ypers (aUpX,aUpY,aUpZ);
gp_Dir Xpers = Ypers.Crossed(Zpers);
gp_Ax3 NewCoordSystem (At, Zpers, Xpers);
gp_Ax3 CurrentCoordSystem(gp_Pnt(0,0,0),gp_Dir(0,0,1));
gp_Trsf Trsf;
Trsf.SetDisplacement(CurrentCoordSystem, NewCoordSystem);
theTrsf = Trsf;
return aProjector;
}
//================================================================
// Function : HLR_Presentation::HLR
// Purpose : creates and displays shape representation by HLRBRep_Algo class
//================================================================
Standard_Boolean HLR_Presentation::HLR(const TopoDS_Shape& aShape, const Standard_Integer nbIso)
{
setResultText(
" TopoDS_Shape aShape;" EOL
" // initializing aShape ..." EOL
"" EOL
" // Build The algorithm object" EOL
" Handle(HLRBRep_Algo) myAlgo = new HLRBRep_Algo();" EOL
" " EOL
" // Add Shapes into the algorithm" EOL
" Standard_Real nbIso = 5; // number of isolines to display" EOL
" myAlgo->Add(aShape, nbIso);" EOL
"" EOL
" // create a projector object" EOL
" Handle(V3d_View) aView;" EOL
" // initializing V3d_View ..." EOL
" " EOL
" Standard_Real aProjVecX, aProjVecY, aProjVecZ;" EOL
" aView->Proj(aProjVecX, aProjVecY, aProjVecZ);" EOL
" " EOL
" Standard_Real aUpX, aUpY, aUpZ;" EOL
" aView->Up(aUpX, aUpY, aUpZ);" EOL
"" EOL
" Standard_Real aPntX = 0.0, aPntY = 0.0, aPntZ = 0.0;" EOL
"" EOL
" // create a projector object" EOL
" Handle(Prs3d_Projector) aProjector = new Prs3d_Projector(Standard_False, 0.0, " EOL
" aProjVecX, aProjVecY, aProjVecZ, aPntX, aPntY, aPntZ, aUpX, aUpY, aUpZ);" EOL
" " EOL
" // Set The Projector" EOL
" myAlgo->Projector(aProjector->Projector());" EOL
" " EOL
" // Launches calculation of outlines of the shape " EOL
" myAlgo->Update();" EOL
"" EOL
" // Computes the visible and hidden lines of the shape " EOL
" myAlgo->Hide();" EOL
" " EOL
" // Build the extraction object :" EOL
" HLRBRep_HLRToShape aHLRToShape(myAlgo);" EOL
" " EOL
" // extract the results of visible parts of the shape:" EOL
" TopoDS_Shape VCompound = aHLRToShape.VCompound();" EOL
" //Visible sharp edges, Sharp edges present a C0 continuity" EOL
" " EOL
" TopoDS_Shape Rg1LineVCompound = aHLRToShape.Rg1LineVCompound();" EOL
" //Visible smooth edges, Smooth edges present a G1 continuity " EOL
"" EOL
" TopoDS_Shape RgNLineVCompound = aHLRToShape.RgNLineVCompound();" EOL
" //Visible sewn edges, Sewn edges present a C2 continuity" EOL
"" EOL
" TopoDS_Shape OutLineVCompound = aHLRToShape.OutLineVCompound();" EOL
" //Visible outline edges" EOL
" " EOL
" TopoDS_Shape IsoLineVCompound = aHLRToShape.IsoLineVCompound();" EOL
" //Visible isoparameters" EOL
" " EOL
" // extract the results of hidden parts of the shape:" EOL
" TopoDS_Shape HCompound = aHLRToShape.HCompound();" EOL
" TopoDS_Shape Rg1LineHCompound = aHLRToShape.Rg1LineHCompound();" EOL
" TopoDS_Shape RgNLineHCompound = aHLRToShape.RgNLineHCompound();" EOL
" TopoDS_Shape OutLineHCompound = aHLRToShape.OutLineHCompound();" EOL
" TopoDS_Shape IsoLineHCompound = aHLRToShape.IsoLineHCompound();" EOL
" " EOL
" " EOL
" //===============================" EOL
" Colors of results:" EOL
" Outlines - MAGENTA" EOL
" Sharp Edges - CYAN" EOL
" Smooth Edges - RED" EOL
" Sewn Edges - ORANGE" EOL
" Isolines - YELLOW" EOL);
// Build The algorithm object
Handle(HLRBRep_Algo) myAlgo = new HLRBRep_Algo();
// Add Shapes into the algorithm
myAlgo->Add(aShape, nbIso);
// create a projector and transformation object
gp_Trsf Trsf;
HLRAlgo_Projector aProjector = Projector(Trsf)->Projector();
TopLoc_Location aLoc(Trsf);
// Set The Projector
myAlgo->Projector(aProjector);
// Launches calculation of outlines of the shape
myAlgo->Update();
// Computes the visible and hidden lines of the shape
myAlgo->Hide();
// Build the extraction object :
HLRBRep_HLRToShape aHLRToShape(myAlgo);
// extract the results of visible parts of the shape:
TopoDS_Shape VCompound = aHLRToShape.VCompound();
//Visible sharp edges, Sharp edges present a C0 continuity
TopoDS_Shape Rg1LineVCompound = aHLRToShape.Rg1LineVCompound();
//Visible smooth edges, Smooth edges present a G1 continuity
TopoDS_Shape RgNLineVCompound = aHLRToShape.RgNLineVCompound();
//Visible sewn edges, Sewn edges present a C2 continuity
TopoDS_Shape OutLineVCompound = aHLRToShape.OutLineVCompound();
//Visible outline edges
TopoDS_Shape IsoLineVCompound = aHLRToShape.IsoLineVCompound();
//Visible isoparameters
// extract the results of hidden parts of the shape:
TopoDS_Shape HCompound = aHLRToShape.HCompound();
TopoDS_Shape Rg1LineHCompound = aHLRToShape.Rg1LineHCompound();
TopoDS_Shape RgNLineHCompound = aHLRToShape.RgNLineHCompound();
TopoDS_Shape OutLineHCompound = aHLRToShape.OutLineHCompound();
TopoDS_Shape IsoLineHCompound = aHLRToShape.IsoLineHCompound();
Handle(AIS_Shape) aShapeIO = drawShape(aShape);
if (WAIT_A_SECOND) return Standard_False;
getAISContext()->Erase(aShapeIO, Standard_False);
// Draw visible and hidden parts of shape.
if (!drawHLR(OutLineVCompound, OutLineHCompound, aLoc, OutLine_COLOR))
return Standard_False;
if (!drawHLR(VCompound, HCompound, aLoc, SharpEdge_COLOR))
return Standard_False;
if (!drawHLR(Rg1LineVCompound, Rg1LineHCompound, aLoc, SmoothEdge_COLOR))
return Standard_False;
if (!drawHLR(RgNLineVCompound, RgNLineHCompound, aLoc, SewnEdge_COLOR))
return Standard_False;
if (!drawHLR(IsoLineVCompound, IsoLineHCompound, aLoc, IsoLine_COLOR))
return Standard_False;
return Standard_True;
}
//================================================================
// Function : HLR_Presentation::PolyHLR
// Purpose : creates and displays shape representation by HLRBRep_PolyAlgo class
//================================================================
Standard_Boolean HLR_Presentation::PolyHLR(const TopoDS_Shape& aShape)
{
setResultText(
" TopoDS_Shape aShape;" EOL
" // initializing aShape ..." EOL
" // triangulating aShape with BRepMesh::Mesh" EOL
"" EOL
" // Build The algorithm object" EOL
" Handle(HLRBRep_PolyAlgo) myPolyAlgo = new HLRBRep_PolyAlgo();" EOL
" " EOL
" // Add Shapes into the algorithm" EOL
" myPolyAlgo->Load(aShape);" EOL
"" EOL
" // create a projector object" EOL
" Handle(V3d_View) aView;" EOL
" // initializing V3d_View ..." EOL
" " EOL
" Standard_Real aProjVecX, aProjVecY, aProjVecZ;" EOL
" aView->Proj(aProjVecX, aProjVecY, aProjVecZ);" EOL
" " EOL
" Standard_Real aUpX, aUpY, aUpZ;" EOL
" aView->Up(aUpX, aUpY, aUpZ);" EOL
"" EOL
" Standard_Real aPntX = 0.0, aPntY = 0.0, aPntZ = 0.0;" EOL
"" EOL
" // create a projector object" EOL
" Handle(Prs3d_Projector) aProjector = new Prs3d_Projector(Standard_False, 0.0, " EOL
" aProjVecX, aProjVecY, aProjVecZ, aPntX, aPntY, aPntZ, aUpX, aUpY, aUpZ);" EOL
" " EOL
" // Set The Projector" EOL
" myPolyAlgo->Projector(aProjector);" EOL
" " EOL
" // Launches calculation of outlines of the shape " EOL
" myPolyAlgo->Update();" EOL
"" EOL
" // Build the extraction object :" EOL
" HLRBRep_PolyHLRToShape aPolyHLRToShape;" EOL
" aPolyHLRToShape.Update(myPolyAlgo);" EOL
" " EOL
" // extract the results of visible parts of the shape:" EOL
" TopoDS_Shape VCompound = aPolyHLRToShape.VCompound();" EOL
" //Visible sharp edges, Sharp edges present a C0 continuity" EOL
" " EOL
" TopoDS_Shape Rg1LineVCompound = aPolyHLRToShape.Rg1LineVCompound();" EOL
" //Visible smooth edges, Smooth edges present a G1 continuity " EOL
"" EOL
" TopoDS_Shape RgNLineVCompound = aPolyHLRToShape.RgNLineVCompound();" EOL
" //Visible sewn edges, Sewn edges present a C2 continuity" EOL
"" EOL
" TopoDS_Shape OutLineVCompound = aPolyHLRToShape.OutLineVCompound();" EOL
" //Visible outline edges" EOL
" " EOL
" // extract the results of hidden parts of the shape:" EOL
" TopoDS_Shape HCompound = aPolyHLRToShape.HCompound();" EOL
" TopoDS_Shape Rg1LineHCompound = aPolyHLRToShape.Rg1LineHCompound();" EOL
" TopoDS_Shape RgNLineHCompound = aPolyHLRToShape.RgNLineHCompound();" EOL
" TopoDS_Shape OutLineHCompound = aPolyHLRToShape.OutLineHCompound();" EOL
" " EOL
" " EOL
" //===============================" EOL
" Colors of results:" EOL
" Outlines - MAGENTA" EOL
" Sharp Edges - CYAN" EOL
" Smooth Edges - RED" EOL
" Sewn Edges - ORANGE" EOL
" Isolines - YELLOW" EOL);
// Build The algorithm object
Handle(HLRBRep_PolyAlgo) myPolyAlgo = new HLRBRep_PolyAlgo();
// Add Shapes into the algorithm
myPolyAlgo->Load(aShape);
// create a projector and transformation object
gp_Trsf Trsf;
HLRAlgo_Projector aProjector = Projector(Trsf)->Projector();
TopLoc_Location aLoc(Trsf);
// Set The Projector
myPolyAlgo->Projector(aProjector);
// Launches calculation of outlines of the shape
myPolyAlgo->Update();
// Build the extraction object :
HLRBRep_PolyHLRToShape aPolyHLRToShape;
aPolyHLRToShape.Update(myPolyAlgo);
// extract the results of visible parts of the shape:
TopoDS_Shape VCompound = aPolyHLRToShape.VCompound();
//Visible sharp edges, Sharp edges present a C0 continuity
TopoDS_Shape Rg1LineVCompound = aPolyHLRToShape.Rg1LineVCompound();
//Visible smooth edges, Smooth edges present a G1 continuity
TopoDS_Shape RgNLineVCompound = aPolyHLRToShape.RgNLineVCompound();
//Visible sewn edges, Sewn edges present a C2 continuity
TopoDS_Shape OutLineVCompound = aPolyHLRToShape.OutLineVCompound();
//Visible outline edges
// extract the results of hidden parts of the shape:
TopoDS_Shape HCompound = aPolyHLRToShape.HCompound();
TopoDS_Shape Rg1LineHCompound = aPolyHLRToShape.Rg1LineHCompound();
TopoDS_Shape RgNLineHCompound = aPolyHLRToShape.RgNLineHCompound();
TopoDS_Shape OutLineHCompound = aPolyHLRToShape.OutLineHCompound();
Handle(AIS_Shape) aShapeIO = drawShape(aShape);
if (WAIT_A_SECOND) return Standard_False;
getAISContext()->Erase(aShapeIO, Standard_False);
// Draw visible and hidden parts of shape.
if (!drawHLR(OutLineVCompound, OutLineHCompound, aLoc, OutLine_COLOR))
return Standard_False;
if (!drawHLR(VCompound, HCompound, aLoc, SharpEdge_COLOR))
return Standard_False;
if (!drawHLR(Rg1LineVCompound, Rg1LineHCompound, aLoc, SmoothEdge_COLOR))
return Standard_False;
if (!drawHLR(RgNLineVCompound, RgNLineHCompound, aLoc, SewnEdge_COLOR))
return Standard_False;
return Standard_True;
}
//================================================================
// Function : HLR_Presentation::drawHLR
// Purpose : moves a given shape to the given location, displays it.
// for visible shape using Aspect_TOL_SOLID line type
// for hidden shape using Aspect_TOL_DASH line type
//================================================================
Standard_Boolean HLR_Presentation::drawHLR(TopoDS_Shape& aVShape,
TopoDS_Shape& aHShape,
const TopLoc_Location& aLoc,
const enum Quantity_NameOfColor aColor)
{
Standard_Boolean VShapeIsNull = aVShape.IsNull();
Standard_Boolean HShapeIsNull = aHShape.IsNull();
if (VShapeIsNull && HShapeIsNull) return Standard_True;
if (!VShapeIsNull)
{
// move the shape to an absolute location
aVShape.Location(aLoc);
// create a look for a line according to aColor and aLineType
Handle(AIS_Shape) anIO = drawShape(aVShape, aColor, Standard_False);
anIO->Attributes()->WireAspect()->SetTypeOfLine(Aspect_TOL_SOLID);
getAISContext()->Display(anIO, HShapeIsNull);
}
if (!HShapeIsNull)
{
// move the shape to an absolute location
aHShape.Location(aLoc);
// create a look for a line according to aColor and aLineType
Handle(AIS_Shape) anIO = drawShape(aHShape, aColor, Standard_False);
anIO->Attributes()->WireAspect()->SetTypeOfLine(Aspect_TOL_DASH);
getAISContext()->Display(anIO);
}
return !WAIT_A_SECOND;
}
//////////////////////////////////////////////////////////////////////
// Sample functions
//////////////////////////////////////////////////////////////////////
//================================================================
// Function : HLR_Presentation::sampleCylinder
// Purpose :
//================================================================
void HLR_Presentation::sampleCylinder()
{
// define cylinder's radius and height
Standard_Real aRadius = 20;
Standard_Real aHeight = 50;
// make cylinder
TopoDS_Solid aShape = BRepPrimAPI_MakeCylinder(aRadius, aHeight);
Standard_Integer nbIso = 3;
if (!HLR(aShape, nbIso)) return;
}
//================================================================
// Function : HLR_Presentation::sampleTorus
// Purpose :
//================================================================
void HLR_Presentation::sampleTorus()
{
//define toroidal surface's axis
gp_Ax3 anAx3(gp_Pnt(0,0,0), gp_Dir(1,0,0));
//define two radiuses
Standard_Real MajorRadius = 20;
Standard_Real MinorRadius = 10;
//make torus
Handle(Geom_ToroidalSurface) aTorSurface = new Geom_ToroidalSurface(anAx3, MajorRadius, MinorRadius);
TopoDS_Shell aShape = BRepBuilderAPI_MakeShell(aTorSurface);
Standard_Integer nbIso = 3;
if (!HLR(aShape, nbIso)) return;
}
//================================================================
// Function : HLR_Presentation::sampleBox
// Purpose :
//================================================================
void HLR_Presentation::sampleBrepShape2()
{
// read a shape from shape2.brep file in DATA dir
TopoDS_Shape aShape;
BRep_Builder aBuilder;
TCollection_AsciiString aFileName(GetDataDir());
aFileName += "\\shape2.brep";
Standard_Boolean Result = BRepTools::Read(aShape, aFileName.ToCString(), aBuilder);
if (!Result)
{
aFileName += " was not found. The sample can not be shown.";
setResultText(aFileName.ToCString());
return;
}
Standard_Integer nbIso = 0;
if (!HLR(aShape, nbIso)) return;
}
//================================================================
// Function : HLR_Presentation::sampleShape1
// Purpose :
//================================================================
void HLR_Presentation::sampleBrepShape1()
{
// read a shape from shape1.brep file in DATA dir
TopoDS_Shape aShape;
BRep_Builder aBuilder;
TCollection_AsciiString aFileName(GetDataDir());
aFileName += "\\shape1.brep";
Standard_Boolean Result = BRepTools::Read(aShape, aFileName.ToCString(), aBuilder);
if (!Result)
{
aFileName += " was not found. The sample can not be shown.";
setResultText(aFileName.ToCString());
return;
}
// triangulating the shape
Standard_Real Deflection = 50;
BRepMesh::Mesh(aShape, Deflection);
if (!PolyHLR(aShape)) return;
}

View File

@ -1,50 +0,0 @@
// HLR_Presentation.h: interface for the HLR_Presentation class.
// Hidden lines removal
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_HLR_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_HLR_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class TopoDS_Shape;
class Prs3d_Projector;
class gp_Trsf;
class TopLoc_Location;
class HLR_Presentation : public OCCDemo_Presentation
{
public:
// Construction
HLR_Presentation();
public:
// Iteration on samples
virtual void DoSample();
// one phase of iterations
private:
Handle(Prs3d_Projector) Projector(gp_Trsf& theTrsf);
Standard_Boolean HLR(const TopoDS_Shape&, const Standard_Integer nbIso);
Standard_Boolean PolyHLR(const TopoDS_Shape&);
Standard_Boolean drawHLR(TopoDS_Shape&, TopoDS_Shape&, const TopLoc_Location&,
const enum Quantity_NameOfColor);
// Sample functions
void sampleCylinder();
void sampleTorus();
void sampleBrepShape2();
void sampleBrepShape1();
private:
// Array of pointers to sample functions
typedef void (HLR_Presentation::*PSampleFuncType)();
static const PSampleFuncType SampleFuncs[];
};
#endif // !defined(AFX_HLR_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,428 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Interpol"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/Interpol.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Debug/Interpol.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/Interpol.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/Interpol.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/Interpol.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Release/Interpol.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/Interpol.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/Interpol.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="Interpol_Presentation.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="Interpol_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,351 +0,0 @@
// Interpol_Presentation.cpp: implementation of the Interpol_Presentation class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Interpol_Presentation.h"
#include <gp_Pnt.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <Precision.hxx>
#include <GeomAPI_Interpolate.hxx>
#include <Geom_BSplineCurve.hxx>
#include <gp_Vec.hxx>
#include <TColStd_HArray1OfBoolean.hxx>
#include <TColgp_Array1OfVec.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <GeomLProp_CLProps.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#ifdef WNT
#define EOL "\r\n"
#else
#define EOL "\n"
#endif
// Initialization of global variable with an instance of this class
OCCDemo_Presentation* OCCDemo_Presentation::Current = new Interpol_Presentation;
// Initialization of array of samples
const Interpol_Presentation::PSampleFuncType Interpol_Presentation::SampleFuncs[] =
{
&Interpol_Presentation::sample1,
&Interpol_Presentation::sample2,
&Interpol_Presentation::sample3,
};
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Interpol_Presentation::Interpol_Presentation()
{
myIndex = 0;
myNbSamples = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
setName ("Interpolation of a set of points to form a curve");
}
//////////////////////////////////////////////////////////////////////
// Sample execution
//////////////////////////////////////////////////////////////////////
void Interpol_Presentation::DoSample()
{
setResultTitle("Interpolation");
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbSamples)
(this->*SampleFuncs[myIndex])();
}
//================================================================
// Function : calculateNewTangent
// Purpose : finds a tangent at the given point on the given curve,
// rotate it by <angle> in the plane of the tangent and normal to
// the curve in this point.
// Output : vectors theTan, theNewTan.
// Returns : false if failed, true if ok.
//================================================================
static Standard_Boolean calculateNewTangent(const Handle(Geom_BSplineCurve)& anInterpolationCurve,
gp_Pnt aPointOnCurve, gp_Vec& theTan, gp_Vec& theNewTan,
Standard_Real angle)
{
GeomLProp_CLProps aLProps (anInterpolationCurve, 2, Precision::Confusion());
GeomAPI_ProjectPointOnCurve aProjector(aPointOnCurve, anInterpolationCurve);
aLProps.SetParameter (aProjector.LowerDistanceParameter());
gp_Dir aTangent, aNormal;
// the tangent and must be defined to compute the normal
if (aLProps.IsTangentDefined())
{
aLProps.Tangent (aTangent);
Standard_Real aCurvature = aLProps.Curvature();
// the curvature must be non-null and finite to compute the normal
if (aCurvature > Precision::Confusion() && !Precision::IsInfinite(aCurvature))
aLProps.Normal (aNormal);
else return Standard_False;
}
else return Standard_False;
gp_Dir aPlaneNormal(aTangent.XYZ() ^ aNormal.XYZ());
gp_Ax1 anAx(aPointOnCurve, aPlaneNormal);
theTan = aTangent;
theNewTan = theTan.Rotated(anAx, angle);
return Standard_True;
}
//================================================================
// Function : interpolate
// Purpose : builds interpolation curve using given Pnts
//================================================================
void Interpol_Presentation::interpolate (Standard_Real aCoords[][3],
Standard_Integer nPnts,
TCollection_AsciiString& theText,
const TColStd_Array1OfInteger& indexes,
const TColStd_Array1OfReal& angles)
{
theText += EOL
" Standard_Integer nPnts = sizeof(aCoords)/(sizeof(Standard_Real)*3);" EOL
" Handle(TColgp_HArray1OfPnt) aPnts = new TColgp_HArray1OfPnt(1, nPnts);" EOL
" for (Standard_Integer i=0; i < nPnts; i++)" EOL
" {" EOL
" gp_Pnt aPnt(aCoords[i][0]*75-400, aCoords[i][1]*75-400, aCoords[i][2]*75-400);" EOL
" aPnts->SetValue(i+1, aPnt);" EOL
" drawPoint(aPnt);" EOL
" if (WaitForInput(250)) return;" EOL
" }" EOL EOL
" //=====================================" EOL
" // Creating a non periodic interpolation curve without constraints " EOL
" // (type of resulting curve is BSpline)" EOL
" Standard_Boolean isPeriodic = Standard_False;" EOL
" GeomAPI_Interpolate aNoPeriodInterpolate(aPnts, isPeriodic, Precision::Confusion());" EOL
" aNoPeriodInterpolate.Perform();" EOL
" // check results" EOL
" if (!aNoPeriodInterpolate.IsDone()) return;" EOL
" Handle(Geom_BSplineCurve) anInterpolationCurve = aNoPeriodInterpolate.Curve();" EOL EOL
" //===================================" EOL
" // Creating a constrained interpolation curve" EOL
" TColgp_Array1OfVec aConstraints(1, nPnts);" EOL
" Handle(TColStd_HArray1OfBoolean) aFlags = new TColStd_HArray1OfBoolean(1, nPnts);" EOL
" Handle(TColStd_HArray1OfBoolean) aCopyFlags = new TColStd_HArray1OfBoolean(1, nPnts);" EOL
" Standard_Boolean toScale = Standard_False;" EOL EOL
" // some code initializing arrays aConstraints and aCopyFlags" EOL
" aCopyFlags->Init(Standard_False);" EOL
" aCopyFlags->SetValue(1, Standard_True);" EOL
" aConstraints(1) = aTanVec;" EOL
" // ..." EOL
" //" EOL EOL
" // Loading constraints and perform" EOL
" aFlags->ChangeArray1() = aCopyFlags->Array1();" EOL
" aNoPeriodInterpolate.Load(aConstraints, aFlags, toScale);" EOL
" aNoPeriodInterpolate.Perform();" EOL
" // check results" EOL
" if (!aNoPeriodInterpolate.IsDone()) return;" EOL
" anInterpolationCurve = aNoPeriodInterpolate.Curve();" EOL EOL
" //==================================================" EOL
" // Creating a periodic interpolation curve" EOL
" isPeriodic = Standard_True;" EOL
" GeomAPI_Interpolate aPeriodInterpolate(aPnts, isPeriodic, Precision::Confusion());" EOL
" // Loading constraints and perform" EOL
" aFlags->ChangeArray1() = aCopyFlags->Array1();" EOL
" aPeriodInterpolate.Load(aConstraints, aFlags, toScale);" EOL
" aPeriodInterpolate.Perform();" EOL
" // check results" EOL
" if (!aPeriodInterpolate.IsDone()) return;" EOL
" anInterpolationCurve = aPeriodInterpolate.Curve();" EOL;
setResultText(theText.ToCString());
Handle(TColgp_HArray1OfPnt) aPnts = new TColgp_HArray1OfPnt(1, nPnts);
for (Standard_Integer i=0; i < nPnts; i++)
{
gp_Pnt aPnt(aCoords[i][0]*75-400, aCoords[i][1]*75-400, aCoords[i][2]*75-400);
aPnts->SetValue(i+1, aPnt);
drawPoint(aPnt);
if (WaitForInput(250)) return;
}
//=====================================
// Creating a non periodic interpolation curve without constraints
// (type of resulting curve is BSpline)
Standard_Boolean isPeriodic = Standard_False;
GeomAPI_Interpolate aNoPeriodInterpolate(aPnts, isPeriodic, Precision::Confusion());
aNoPeriodInterpolate.Perform();
// check results
if (!aNoPeriodInterpolate.IsDone()) return;
Handle(Geom_BSplineCurve) anInterpolationCurve = aNoPeriodInterpolate.Curve();
Handle(AIS_InteractiveObject) aShowCurve = drawCurve(anInterpolationCurve);
if (WAIT_A_SECOND) return;
//===================================
// Creating several constrained interpolation curves
TColgp_Array1OfVec aConstraints(1, nPnts);
Handle(TColStd_HArray1OfBoolean) aFlags = new TColStd_HArray1OfBoolean(1, nPnts);
Handle(TColStd_HArray1OfBoolean) aCopyFlags = new TColStd_HArray1OfBoolean(1, nPnts);
Standard_Boolean toScale = Standard_False;
Standard_Real scaleVec = 1;
aCopyFlags->Init(Standard_False);
Handle(AIS_InteractiveObject) aShowTan;
for (i = indexes.Lower(); i <= indexes.Upper(); i++)
{
gp_Pnt aPoint = aPnts->Value(indexes(i));
Standard_Real anAngle = angles(i);
gp_Vec aTan, aNewTan;
if (!calculateNewTangent(anInterpolationCurve, aPoint, aTan, aNewTan, anAngle))
return;
if (!aShowTan.IsNull()) getAISContext()->Erase(aShowTan);
aShowTan = drawVector(aPoint, aTan.Scaled(300));
if (WAIT_A_LITTLE) return;
aCopyFlags->SetValue(indexes(i), Standard_True);
aConstraints(indexes(i)) = aNewTan * scaleVec;
aFlags->ChangeArray1() = aCopyFlags->Array1();
aNoPeriodInterpolate.Load(aConstraints, aFlags, toScale);
aNoPeriodInterpolate.Perform();
if (!aNoPeriodInterpolate.IsDone()) return;
// replacing the curve with a new one, so calculation of the next tagent
// on the next point from indexes will be done using the new curve
anInterpolationCurve = aNoPeriodInterpolate.Curve();
// display a new curve and new vector
getAISContext()->Erase(aShowTan);
getAISContext()->Erase(aShowCurve);
aShowCurve = drawCurve(anInterpolationCurve);
aShowTan = drawVector(aPoint, aNewTan.Scaled(300));
if (WAIT_A_SECOND) return;
}
//==================================================
// Creating a periodic interpolation curve
isPeriodic = Standard_True;
GeomAPI_Interpolate aPeriodInterpolate(aPnts, isPeriodic, Precision::Confusion());
aFlags->ChangeArray1() = aCopyFlags->Array1();
aPeriodInterpolate.Load(aConstraints, aFlags, toScale);
aPeriodInterpolate.Perform();
// the interpolation can not be computed
if (!aPeriodInterpolate.IsDone()) return;
anInterpolationCurve = aPeriodInterpolate.Curve();
getAISContext()->Erase(aShowTan);
getAISContext()->Erase(aShowCurve);
drawCurve(anInterpolationCurve);
}
//////////////////////////////////////////////////////////////////////
// Sample functions
//////////////////////////////////////////////////////////////////////
//================================================================
// Function : Interpol_Presentation::sample1
// Purpose :
//================================================================
void Interpol_Presentation::sample1()
{
ResetView();
SetViewCenter(-43,-333);
SetViewScale(1.4210);
TCollection_AsciiString aText(
" // initializing array of points to interpolate" EOL
" Standard_Real aCoords[][3] = {{0,0,0},{3,5,0},{4,7,0},{10,10,0}};" EOL
);
// initializing array of interpolation curve Pnts
Standard_Real aCoords[][3] = {{0,0,0},{3,5,0},{4,7,0},{10,10,0}};
// initializing array of indexes of points where the constraints will be applied
TColStd_Array1OfInteger indexes(1,2);
indexes(1) = 1;
indexes(2) = 2;
// initializing array of angles of tagent rotation in the points
// with indexes from the array defined above.
TColStd_Array1OfReal aAngles(1,2);
aAngles(1) = PI/2;
aAngles(2) = -PI/4;
interpolate(aCoords, sizeof(aCoords)/(sizeof(Standard_Real)*3),
aText, indexes, aAngles);
}
//================================================================
// Function : Interpol_Presentation::sample2
// Purpose :
//================================================================
void Interpol_Presentation::sample2()
{
ResetView();
SetViewCenter(-148.74,-603.06);
SetViewScale(1.09);
TCollection_AsciiString aText(
" // initializing array of points to interpolate" EOL
" Standard_Real aCoords[][3] = {{0,-1,0},{1,1,0},{4,5,0},{9,0,0},{13,3,0},{16,-5,0}};" EOL
);
// initializing array of interpolation curve Pnts
Standard_Real aCoords[][3] = {{0,-1,0},{1,1,0},{4,5,0},{9,0,0},{13,3,0},{16,-5,0}};
// initializing array of indexes of points where the constraints will be applied
TColStd_Array1OfInteger indexes(1,3);
indexes(1) = 1;
indexes(2) = 2;
indexes(3) = 6;
// initializing array of angles of tagent rotation in the points
// with indexes from the array defined above.
TColStd_Array1OfReal aAngles(1,3);
aAngles(1) = -PI/4;
aAngles(2) = -PI/3;
aAngles(3) = +PI/3;
interpolate(aCoords, sizeof(aCoords)/(sizeof(Standard_Real)*3),
aText, indexes, aAngles);
}
//================================================================
// Function : Interpol_Presentation::sample3
// Purpose :
//================================================================
void Interpol_Presentation::sample3()
{
ResetView();
SetViewCenter(374.27539,185.40618);
SetViewScale(0.87185);
TCollection_AsciiString aText(
" // initializing array of points to interpolate" EOL
" Standard_Real aCoords[][3] = {{10,0,11},{13,15,10},{7,13,12},{10,0,5}};" EOL
);
// initializing array of interpolation curve Pnts
Standard_Real aCoords[][3] = {{10,0,11},{13,15,10},{7,13,12},{5,5,9}};
TColStd_Array1OfInteger indexes(1,2);
indexes(1) = 2; indexes(2) = 4;
TColStd_Array1OfReal aAngles(1,2);
aAngles(1) = PI/4; aAngles(2) = -PI/3;
interpolate(aCoords, sizeof(aCoords)/(sizeof(Standard_Real)*3),
aText, indexes, aAngles);
}

View File

@ -1,48 +0,0 @@
// Interpol_Presentation.h: interface for the Interpol_Presentation class.
// Presentation class: Interpolation of a set of points to form a curve
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_Interpol_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_Interpol_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class Geom_BSplineCurve;
#include <TColgp_HArray1OfPnt.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
class Interpol_Presentation : public OCCDemo_Presentation
{
public:
// Construction
Interpol_Presentation();
public:
// Iteration on samples
virtual void DoSample();
// one phase of iterations
private:
void interpolate (Standard_Real[][3],
Standard_Integer, TCollection_AsciiString&,
const TColStd_Array1OfInteger& thePointIndexes,
const TColStd_Array1OfReal& theAngles);
// Sample functions
void sample1();
void sample2();
void sample3();
private:
// Array of pointers to sample functions
typedef void (Interpol_Presentation::*PSampleFuncType)();
static const PSampleFuncType SampleFuncs[];
};
#endif // !defined(AFX_Interpol_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,450 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Intersections"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/Intersections.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
BrowseInformation="1"
BrowseInformationFile=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Debug/Intersections.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/Intersections.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/Intersections.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/Intersections.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
BrowseInformation="1"
BrowseInformationFile=".\../Release/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Release/Intersections.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/Intersections.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/Intersections.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="Intersections_Presentation.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="Intersections_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,518 +0,0 @@
// Intersections_Presentation.cpp: implementation of the Intersections_Presentation class.
// Intersections of curves and surfaces
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Intersections_Presentation.h"
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2dAPI_PointsToBSpline.hxx>
#include <GeomAPI_PointsToBSpline.hxx>
#include <GeomAPI_PointsToBSplineSurface.hxx>
#include <GeomAPI_IntCS.hxx>
#include <GeomAPI_IntSS.hxx>
#include <Geom2dAPI_InterCurveCurve.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Dir.hxx>
#include <gp_Ax2.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
// Initialization of global variable with an instance of this class
OCCDemo_Presentation* OCCDemo_Presentation::Current = new Intersections_Presentation;
// Initialization of array of samples
const Intersections_Presentation::PSampleFuncType Intersections_Presentation::SampleFuncs[] =
{
&Intersections_Presentation::InterCurveCurve,
&Intersections_Presentation::SelfInterCurveCurve,
&Intersections_Presentation::InterCurveSurface,
&Intersections_Presentation::InterSurfaceSurface,
};
#ifdef WNT
#define EOL "\r\n"
#else
#define EOL "\n"
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Intersections_Presentation::Intersections_Presentation()
{
myNbSamples = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
setName ("Intersections of curves and surfaces");
}
//////////////////////////////////////////////////////////////////////
// Sample execution
//////////////////////////////////////////////////////////////////////
void Intersections_Presentation::DoSample()
{
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbSamples)
(this->*SampleFuncs[myIndex])();
}
//////////////////////////////////////////////////////////////////////
// Functions
//////////////////////////////////////////////////////////////////////
static Handle(Geom2d_BSplineCurve) create2dBSplineCurve(const Standard_Integer thePoles,
const Standard_Real theCoords[][2])
{
TColgp_Array1OfPnt2d thePoints(1, thePoles);
for (Standard_Integer i=0; i < thePoles; i++)
thePoints(i+1) = gp_Pnt2d (theCoords[i][0]*100, theCoords[i][1]*100);
Standard_Integer MinDegree = 3;
Standard_Integer MaxDegree = 8;
return Geom2dAPI_PointsToBSpline (
thePoints, MinDegree, MaxDegree);
}
static Handle(Geom_BSplineSurface) createBSplineSurface(const Standard_Real theZCoords[],
const Standard_Real theXStep,
const Standard_Real theYStep,
const Standard_Real theXBound,
const Standard_Real theYBound)
{
TColStd_Array2OfReal aZPoints(1,4,1,4);
Standard_Integer aColLength = aZPoints.ColLength();
Standard_Integer aRowLength = aZPoints.RowLength();
Standard_Integer aIndex = 0;
Standard_Integer k = 100;
for(Standard_Integer i = 0 ; i < aRowLength ; i++)
for(Standard_Integer j = 0; j < aColLength ; j++)
aZPoints(i+1,j+1) = (theZCoords[aIndex++] * k);
return GeomAPI_PointsToBSplineSurface (
aZPoints,theXBound,theXStep,theYBound,theYStep,3,8);
}
//==========================================================================================
// Function : Intersections_Presentation::InterCurveCurve
// Purpose :
//==========================================================================================
void Intersections_Presentation::InterCurveCurve()
{
setResultTitle("Intersection of 2d curves");
TCollection_AsciiString aText(
" // define two 2d curves" EOL
" Handle(Geom2d_Curve) aCurve1,aCurve2;" EOL
" // initializing curves ..." EOL EOL
" // construct algo" EOL
" Standard_Real Tol = 2;" EOL
" Geom2dAPI_InterCurveCurve aInterCC(aCurve1,aCurve2,Tol);" EOL EOL
" // number of intersection points" EOL
" Standard_Integer aNumberPoints = aInterCC.NbPoints();" EOL EOL
" // evaluate solutions" EOL
" for(Standard_Integer i = 1; i <= aNumberPoints; i++)" EOL
" {" EOL
" gp_Pnt2d aPnt = aInterCC.Point(i);" EOL
" // use point as you need ..." EOL
" }" EOL EOL
" // number of tangential intersections " EOL
" Standard_Integer aNumberSegments = aInterCC.NbSegments();" EOL EOL
" // evaluate solutions" EOL
" for(Standard_Integer j = 1; j <= aNumberSegments; j++)" EOL
" {" EOL
" Handle(Geom2d_Curve) a2dCurve1,a2dCurve2;" EOL
" aInterCC.Segment(j,a2dCurve1,a2dCurve2);" EOL
" // use curves as you need ..." EOL
" }" EOL EOL
);
setResultText(aText.ToCString());
// define arrays of points
Standard_Real aPolesCoords1[][2] = {
{-6,0.5},{-5,1},{-2,0},{-1,-1.01},{0,-3},{2,-4},{4,-1},{5,0}
};
Standard_Real aPolesCoords2[][2] = {{-6,1},{-5,0},{-4,-1},
{-3,-1},{-2,0},{-1,-1},{0,-2.5},{1,-3.4},{2,-2},{3,-2},{4,-2},{5,-3}
};
// define arrays lengths
Standard_Integer nPoles1 = sizeof(aPolesCoords1)/(sizeof(Standard_Real)*2);
Standard_Integer nPoles2 = sizeof(aPolesCoords2)/(sizeof(Standard_Real)*2);
// make two bspline curves
Handle(Geom2d_BSplineCurve) aCurve1 = create2dBSplineCurve(nPoles1,aPolesCoords1);
Handle(Geom2d_BSplineCurve) aCurve2 = create2dBSplineCurve(nPoles2,aPolesCoords2);
// construct algo
Standard_Real Tol = 2;
Geom2dAPI_InterCurveCurve aInterCC(aCurve1,aCurve2,Tol);
// number of intersection points
Standard_Integer aNumberPoints = aInterCC.NbPoints();
// number of tangential intersections
Standard_Integer aNumberSegments = aInterCC.NbSegments();
// output
aText = aText +
" //=================================================" EOL EOL
" Number of intersection points = " + TCollection_AsciiString(aNumberPoints) + EOL
" Number of tangential intersections = " + TCollection_AsciiString(aNumberSegments) + EOL;
setResultText(aText.ToCString());
gp_Pnt aPoint(0,0,0);
gp_Dir aDir(0,0,1);
gp_Ax2 anAx2(aPoint,aDir);
drawCurve(aCurve1,Quantity_Color(Quantity_NOC_RED),Standard_True,anAx2);
drawCurve(aCurve2,Quantity_Color(Quantity_NOC_RED),Standard_True,anAx2);
if(WAIT_A_SECOND) return;
// output intersection points
if (aNumberPoints > 0)
for(Standard_Integer i = 1; i <= aNumberPoints; i++)
{
drawPoint(gp_Pnt(aInterCC.Point(i).X(),aInterCC.Point(i).Y(),0));
}
if(WAIT_A_SECOND) return;
if (aNumberSegments > 0)
for(Standard_Integer j = 1; j <= aNumberSegments; j++)
{
Handle(Geom2d_Curve) a2dCurve1;
Handle(Geom2d_Curve) a2dCurve2;
aInterCC.Segment(j,a2dCurve1,a2dCurve2);
drawCurve(a2dCurve1,Quantity_Color(Quantity_NOC_YELLOW),Standard_True,anAx2);
drawCurve(a2dCurve2,Quantity_Color(Quantity_NOC_YELLOW),Standard_True,anAx2);
}
}
//==========================================================================================
// Function : Intersections_Presentation::SelfInterCurveCurve
// Purpose :
//==========================================================================================
void Intersections_Presentation::SelfInterCurveCurve()
{
setResultTitle("Self-intersection of 2d curve");
TCollection_AsciiString aText(
" // define 2d curve" EOL
" Handle(Geom2d_Curve) aCurve1;" EOL
" // initializing curve ..." EOL EOL
" // construct algo" EOL
" Standard_Real Tol = 2;" EOL
" Geom2dAPI_InterCurveCurve aInterCC(aCurve1,Tol);" EOL EOL
" // number of intersection points" EOL
" Standard_Integer aNumberPoints = aInterCC.NbPoints();" EOL EOL
" // evaluate solutions" EOL
" for(Standard_Integer i = 1; i <= aNumberPoints; i++)" EOL
" {" EOL
" gp_Pnt2d aPnt = aInterCC.Point(i);" EOL
" // use point as you need ..." EOL
" }" EOL EOL
" // number of tangential intersections " EOL
" Standard_Integer aNumberSegments = aInterCC.NbSegments();" EOL EOL
" // evaluate solutions" EOL
" for(Standard_Integer j = 1; j <= aNumberSegments; j++)" EOL
" {" EOL
" Handle(Geom2d_Curve) a2dCurve1;" EOL
" aInterCC.Segment(j,a2dCurve1);" EOL
" // use curve as you need ..." EOL
" }" EOL EOL
);
setResultText(aText.ToCString());
// define array of points
Standard_Real aPolesCoords1[][2] = {
{-5,-2},{-4,-1},{0,2.4},{6,4},{6,-3},
{1,-1},{-3,2},{-1,2.2},{3,3.5},{4,4.9}
};
// define array length
Standard_Integer nPoles1 = sizeof(aPolesCoords1)/(sizeof(Standard_Real)*2);
// make bspline curve
Handle(Geom2d_BSplineCurve) aCurve1 = create2dBSplineCurve(nPoles1,aPolesCoords1);
// construct algo
Standard_Real Tol = 2;
Geom2dAPI_InterCurveCurve aInterCC(aCurve1,Tol);
aInterCC.Init(aCurve1,Tol);
// number of intersection points
Standard_Integer aNumberPoints = aInterCC.NbPoints();
// number of tangential intersections
Standard_Integer aNumberSegments = aInterCC.NbSegments();
// output
aText = aText +
" //=================================================" EOL EOL
" Number of intersection points = " + TCollection_AsciiString(aNumberPoints) + EOL
" Number of tangential intersections = " + TCollection_AsciiString(aNumberSegments) + EOL;
setResultText(aText.ToCString());
gp_Pnt aPoint(0,0,0);
gp_Dir aDir(0,0,1);
gp_Ax2 anAx2(aPoint,aDir);
drawCurve(aCurve1,Quantity_Color(Quantity_NOC_RED),Standard_True,anAx2);
if(WAIT_A_SECOND) return;
// output intersection points
for(Standard_Integer i = 1; i <= aNumberPoints; i++)
drawPoint(gp_Pnt(aInterCC.Point(i).X(),aInterCC.Point(i).Y(),0));
if(WAIT_A_SECOND) return;
// output tangential intersections
for(Standard_Integer j = 1; j <= aNumberSegments; j++)
{
Handle(Geom2d_Curve) a2dCurve1;
aInterCC.Segment(j,a2dCurve1);
drawCurve(a2dCurve1,Quantity_Color(Quantity_NOC_YELLOW),Standard_True,anAx2);
}
}
//==========================================================================================
// Function : Intersections_Presentation::InterCurveSurface
// Purpose :
//==========================================================================================
void Intersections_Presentation::InterCurveSurface()
{
setResultTitle("Intersection of curve and surface");
TCollection_AsciiString aText(
" // define curve" EOL
" Handle(Geom_Curve) aCurve;" EOL
" // initializing curve ..." EOL EOL
" // define surface" EOL
" Handle(Geom_Surface) aSurface;" EOL
" // initializing surface ..." EOL EOL
" // construct algo" EOL
" GeomAPI_IntCS aInterCS(aCurve,aSurface);" EOL
" if(!aInterCS.IsDone()) return;" EOL EOL
" // number of intersection points" EOL
" Standard_Integer aNumberPoints = aInterCS.NbPoints();" EOL EOL
" // evaluate solutions" EOL
" for(Standard_Integer i = 1; i <= aNumberPoints; i++)" EOL
" {" EOL
" Standard_Real aParamU,aParamV,aParamOnCurve;" EOL
" aInterCS.Parameters(i,aParamU,aParamV,aParamOnCurve);" EOL
" gp_Pnt aPnt = aInterCS.Point(i);" EOL
" // use solution as you need ..." EOL
" }" EOL EOL
" // number of tangential intersections " EOL
" Standard_Integer aNumberSegments = aInterCS.NbSegments();" EOL EOL
" // evaluate solutions" EOL
" for(Standard_Integer j = 1; j <= aNumberSegments; j++)" EOL
" Handle(Geom_Curve) aCurve1 = aInterCS.Segment(j);" EOL
" // use solution as you need ..." EOL EOL
);
setResultText(aText.ToCString());
// define bounds surface
Standard_Real aXStep = 262.5, aYStep = 262.5;
Standard_Real aXBound = -450, aYBound = -300;
// define array of points
Standard_Real aZCoords [] = {{-1},{0},{0},{0.5},{0},{-1},
{-1},{0},{-1},{-1.5},{-1},{-1},{1},{-1},{-1},{-1}};
// creating bspline surface
Handle(Geom_BSplineSurface) aSurface = createBSplineSurface(aZCoords,aXStep,aYStep,aXBound,aYBound);
// make bspline curve
// define array of points
Standard_Real aCoords[][3] = {{-3,-3,-2},{-2,-2,-1},{-1,-1,-1},
{0,0,1},{1,2,3},{2,1,0},{3,1,-3},{4,2,-4},{5,2,-3}};
Standard_Integer nPoles = sizeof(aCoords)/(sizeof(Standard_Real)*3);
TColgp_Array1OfPnt aCurvePoint (1, nPoles);
for (Standard_Integer n=0; n < nPoles; n++)
aCurvePoint(n+1) = gp_Pnt (aCoords[n][0]*100, aCoords[n][1]*100, aCoords[n][2]*100);
// define parameters
Standard_Integer MinDegree = 3;
Standard_Integer MaxDegree = 8;
// make bspline curve
GeomAPI_PointsToBSpline aCurve(aCurvePoint, MinDegree, MaxDegree);
// construct algo
GeomAPI_IntCS aInterCS(aCurve,aSurface);
if(!aInterCS.IsDone()) return;
// number of intersection points
Standard_Integer aNumberPoints = aInterCS.NbPoints();
// number of tangential intersections
Standard_Integer aNumberSegments = aInterCS.NbSegments();
// define and output parameters points
aText = aText +
" //=================================================" EOL EOL
" Number of intersection points = " + TCollection_AsciiString(aNumberPoints) + EOL
" Number of tangential intersections = " + TCollection_AsciiString(aNumberSegments) + EOL EOL;
if(aNumberPoints > 0)
{
aText = aText +
" Parameters (U,V) on the surface of the intersection point." EOL
" Parameter (ParamOnCurve) on the curve of the intersection point." EOL EOL;
for(Standard_Integer j = 1; j <= aNumberPoints; j++)
{
Standard_Real aParamU,aParamV,aParamOnCurve;
aInterCS.Parameters(j,aParamU,aParamV,aParamOnCurve);
aText = aText +
" Intersection point " + j + " : U = " + TCollection_AsciiString(aParamU) + EOL
" : V = " + TCollection_AsciiString(aParamV) + EOL
" ParamOnCurve = " + TCollection_AsciiString(aParamOnCurve) + EOL EOL;
}
setResultText(aText.ToCString());
}
drawSurface(aSurface);
if(WAIT_A_SECOND) return;
drawCurve(aCurve);
if(WAIT_A_SECOND) return;
for(Standard_Integer i = 1; i <= aNumberPoints; i++)
{
drawPoint(gp_Pnt(aInterCS.Point(i)));
}
for(Standard_Integer k = 1; k <= aNumberSegments; k++)
{
Handle(Geom_Curve) aCurve1 = aInterCS.Segment(k);
drawCurve(aCurve1,Quantity_NOC_YELLOW);
}
}
//==========================================================================================
// Function : Intersections_Presentation::InterSurfaceSurface
// Purpose :
//==========================================================================================
void Intersections_Presentation::InterSurfaceSurface()
{
setResultTitle("Intersection of surfaces");
TCollection_AsciiString aText(
" // define two surfaces" EOL
" Handle(Geom_Surface) aSurface1,aSurface2;" EOL
" // initializing surfaces ..." EOL EOL
" // construct algo" EOL
" Standard_Real Tol = 0.1e-7;" EOL
" GeomAPI_IntSS aInterSS(aSurface1,aSurface2,Tol);" EOL
" if(!aInterSS.IsDone()) return;" EOL EOL
" // number of intersection lines" EOL
" Standard_Integer aNumberLines = aInterSS.NbLines();" EOL EOL
" // evaluate solutions" EOL
" for(Standard_Integer i = 1; i <= aNumberLines; i++)" EOL
" {" EOL
" Handle(Geom_Curve) aCurve = aInterSS.Line(i);" EOL
" // use aCurve as you need ..." EOL
" }" EOL EOL
);
setResultText(aText.ToCString());
// define bounds of surfaces
Standard_Real aXStep1 = 250, aYStep1 = 250;
Standard_Real aXBound1 = -450, aYBound1 = -300;
Standard_Real aXStep2 = 250, aYStep2 = 150;
Standard_Real aXBound2 = -650, aYBound2 = -200;
// define arrays of points
Standard_Real aZCoords1 [] = {{-1},{0},{0},{-0.5},{0},{-1},
{-1},{0},{-1},{-1.5},{-1},{-1},{-2},{-1},{-1},{-1}};
Standard_Real aZCoords2 [] = {{-2},{-1},{-1},{-1},{-1},{-1.5},
{-1.5},{-1},{-1.5},{-1},{0},{0},{-1},{0},{0},{0}};
// make bspline surface
Handle(Geom_BSplineSurface) aSurface1 = createBSplineSurface(aZCoords1,aXStep1,aYStep1,aXBound1,aYBound1);
Handle(Geom_BSplineSurface) aSurface2 = createBSplineSurface(aZCoords2,aXStep2,aYStep2,aXBound2,aYBound2);
// construct algo
Standard_Real Tol = 0.1e-7;
GeomAPI_IntSS aInterSS(aSurface1,aSurface2,Tol);
if(!aInterSS.IsDone()) return;
// number of intersection lines
Standard_Integer aNumberLines = aInterSS.NbLines();
// output
aText = aText +
" //=================================================" EOL EOL
" Number of intersection lines = " + TCollection_AsciiString(aNumberLines) + EOL;
setResultText(aText.ToCString());
drawSurface(aSurface1);
if(WAIT_A_SECOND) return;
drawSurface(aSurface2,Quantity_NOC_YELLOW);
if(WAIT_A_SECOND) return;
Standard_Real aLineWidth = 3.0;
for(Standard_Integer i = 1; i <= aNumberLines; i++)
{
// show intersection line
Handle(Geom_Curve) aCurve = aInterSS.Line(i);
Handle(AIS_InteractiveObject) anIO = drawCurve(aCurve, Quantity_NOC_RED, Standard_False);
Handle(Prs3d_LineAspect) aLA =
new Prs3d_LineAspect(Quantity_NOC_RED,Aspect_TOL_SOLID,aLineWidth);
anIO->Attributes()->SetLineAspect(aLA);
getAISContext()->Display(anIO);
}
}

View File

@ -1,41 +0,0 @@
// Intersections_Presentation.h: interface for the Intersections_Presentation class.
// Intersections of curves and surfaces
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_Intersections_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_Intersections_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class GProp_Intersections;
class TCollection_AsciiString;
class Intersections_Presentation : public OCCDemo_Presentation
{
public:
// Construction
Intersections_Presentation();
public:
// Iteration on samples
virtual void DoSample();
// one phase of iterations
private:
void InterCurveCurve();
void SelfInterCurveCurve();
void InterCurveSurface();
void InterSurfaceSurface();
private:
// Array of pointers to sample functions
typedef void (Intersections_Presentation::*PSampleFuncType)();
static const PSampleFuncType SampleFuncs[];
};
#endif // !defined(AFX_Intersections_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,428 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="LProps"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/LProps.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Debug/LProps.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/LProps.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/LProps.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/LProps.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Release/LProps.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/LProps.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/LProps.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="LProps_Presentation.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="LProps_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,438 +0,0 @@
// LProps_Presentation.cpp: implementation of the LProps_Presentation class.
// Presentation class: Local properties of curves and surfaces
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "LProps_Presentation.h"
#include <Quantity_Color.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <GeomLProp_CLProps.hxx>
#include <Precision.hxx>
#include <Geom_Circle.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <Geom_BezierSurface.hxx>
#include <GeomLProp_SLProps.hxx>
// Initialization of global variable with an instance of this class
OCCDemo_Presentation* OCCDemo_Presentation::Current = new LProps_Presentation;
// Initialization of array of samples
const LProps_Presentation::PSampleFuncType LProps_Presentation::SampleFuncs[] =
{
&LProps_Presentation::sampleBezier,
&LProps_Presentation::samplePBSpline,
&LProps_Presentation::sampleBezierSurface
};
#ifdef WNT
#define EOL "\r\n"
#else
#define EOL "\n"
#endif
#define ASTR(_val) TCollection_AsciiString(_val)
#define PRINT_COORDS(_p) ASTR((_p).X()) + " " + ASTR((_p).Y()) + " " + ASTR((_p).Z())
#define D1Color Quantity_Color(Quantity_NOC_DARKOLIVEGREEN4)
#define D2Color Quantity_Color(Quantity_NOC_DARKOLIVEGREEN)
#define D3Color Quantity_Color(Quantity_NOC_DARKGREEN)
#define TanColor Quantity_Color(Quantity_NOC_GREEN)
#define NormColor Quantity_Color(Quantity_NOC_CYAN4)
#define CrvtColor Quantity_Color(Quantity_NOC_BLUE1)
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
LProps_Presentation::LProps_Presentation()
{
FitMode=false;
myNbSamples = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
setName ("Local Properties of Curves and Surfaces");
}
//////////////////////////////////////////////////////////////////////
// Sample execution
//////////////////////////////////////////////////////////////////////
void LProps_Presentation::DoSample()
{
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbSamples)
(this->*SampleFuncs[myIndex])();
}
//////////////////////////////////////////////////////////////////////
// Sample functions
//////////////////////////////////////////////////////////////////////
void LProps_Presentation::sampleBezier()
{
Standard_CString aName = "BezierCurve";
// Create a BezierCurve
Standard_Real aCoords[][3] = {
{0,0,0},{0,1,0},{1,1,0.2},{1,2,0.2},{2,2,0.4},{2,1,0.4},{3,1,0.6},{3,0,0.6},
{2,0,0.8},{2,-1,0},{3,-1,0},{3,-2,-0.5},{4,-2,1},{4,-1,1.2},{5,-1,1.2},
{5,0,1.4},{6,0,1.4},{6,-1,1.6},{7,-1,1.6},{7,0,1.8},{8,0,1.8},{8,1,2}
};
Standard_Integer nPoles = sizeof(aCoords)/(sizeof(Standard_Real)*3);
TColgp_Array1OfPnt aPoles (1, nPoles);
for (Standard_Integer i=0; i < nPoles; i++)
aPoles(i+1) = gp_Pnt (aCoords[i][0]*100-500, aCoords[i][1]*100, aCoords[i][2]*100);
Handle(Geom_BezierCurve) aCurve = new Geom_BezierCurve (aPoles);
Standard_Real aPoints[] = {0, 0.1, 0.4, 0.6, 0.9};
showCurveLProps (aCurve, aName, sizeof(aPoints)/sizeof(Standard_Real), aPoints);
}
void LProps_Presentation::samplePBSpline()
{
Standard_CString aName = "BSplineCurve";
// Create a Periodic BSplineCurve
Standard_Real aCoords[][3] = {
{0,0,0},{0,1,0},{1,1,0},{1,0,0},{2,0,-0.3},{2,-1,-0.3},{1,-1,0},
{1,-2,0},{0,-2,0},{0,-1,0},{-1,-1,0.3},{-1,0,0.3}
};
Standard_Integer nPoles = sizeof(aCoords)/(sizeof(Standard_Real)*3);
TColgp_Array1OfPnt aPoles (1, nPoles);
TColStd_Array1OfReal aKnots (1, nPoles+1);
TColStd_Array1OfInteger aMults(1, nPoles+1);
for (Standard_Integer i=0; i < nPoles; i++)
aPoles(i+1) = gp_Pnt (aCoords[i][0]*200, aCoords[i][1]*200, aCoords[i][2]*200);
for (i=0; i < aKnots.Length(); i++)
aKnots(i+1) = Standard_Real(i)/aKnots.Length();
aMults.Init(1);
Standard_Integer aDegree = 3;
Standard_Boolean isPeriodic = Standard_True;
Handle(Geom_BSplineCurve) aCurve =
new Geom_BSplineCurve (aPoles, aKnots, aMults, aDegree, isPeriodic);
Standard_Real aPoints[] = {0, 0.1, 0.4, 0.6, 0.8};
showCurveLProps (aCurve, aName, sizeof(aPoints)/sizeof(Standard_Real), aPoints);
}
void LProps_Presentation::sampleBezierSurface()
{
Standard_CString aName = "BezierSurface";
// Create a BezierSurface
TColgp_Array2OfPnt aPoles(1,2,1,4); // 8 points
TColStd_Array2OfReal aWeights(1,2,1,4);
// initializing array of points
aPoles.SetValue(1,1,gp_Pnt(0,10,0)); aPoles.SetValue(1,2,gp_Pnt(3.3,6.6,3));
aPoles.SetValue(1,3,gp_Pnt(6.6,6.6,-3)); aPoles.SetValue(1,4,gp_Pnt(10,10,0));
aPoles.SetValue(2,1,gp_Pnt(0,0,0)); aPoles.SetValue(2,2,gp_Pnt(3.3,3.3,-3));
aPoles.SetValue(2,3,gp_Pnt(6.6,3.3,3)); aPoles.SetValue(2,4,gp_Pnt(10,0,0));
// scaling poles
for (Standard_Integer i=1; i <= aPoles.ColLength(); i++)
for (Standard_Integer j=1; j <= aPoles.RowLength(); j++)
aPoles(i,j).ChangeCoord() = aPoles(i,j).Coord() * 100 + gp_XYZ(-500,-500,0);
//initializing array of weights
aWeights.SetValue(1,1,1); aWeights.SetValue(1,2,3);
aWeights.SetValue(1,3,9); aWeights.SetValue(1,4,1);
aWeights.SetValue(2,1,1); aWeights.SetValue(2,2,2);
aWeights.SetValue(2,3,5); aWeights.SetValue(2,4,1);
Handle(Geom_BezierSurface) aSurface =
new Geom_BezierSurface(aPoles, aWeights);
Standard_Real aPoints[][2] = {{0.1,0}, {0.8,0.1}, {0.4,0.3}, {0.6,0.9}, {0.9,0.98}};
showSurfaceLProps (aSurface, aName,
sizeof(aPoints)/(sizeof(Standard_Real)*2), aPoints);
}
void LProps_Presentation::showCurveLProps (Handle(Geom_Curve) theCurve,
const Standard_CString theName,
const Standard_Integer theNbPoints,
const Standard_Real thePoints[])
{
TCollection_AsciiString aTitle ("Local properties of a ");
aTitle += theName;
TCollection_AsciiString aText;
aText = aText +
" // Create a " + theName + EOL
" Handle(Geom_" + theName + ") aCurve;" EOL
" // initialize aCurve" EOL
" // aCurve = ..." EOL EOL
" // define parameter at which properties should be computed" EOL
" Standard_Real aParam;" EOL
" // aParam = ..." EOL EOL
" // compute local properties" EOL
" Standard_Integer maxOrder = 3;" EOL
" Standard_Real aResol = gp::Resolution();" EOL
" GeomLProp_CLProps aLProps (theCurve, maxOrder, aResol);" EOL
" aLProps.SetParameter (aParam);" EOL
" gp_Pnt aPnt = aLProps.Value();" EOL
" gp_Vec aVecD1 = aLProps.D1();" EOL
" gp_Vec aVecD2 = aLProps.D2();" EOL
" gp_Vec aVecD3 = aLProps.D3();" EOL
" gp_Dir aTangent, aNormal;" EOL
" Standard_Real aCurvature;" EOL
" gp_Pnt aCentreOfCurvature;" EOL
" Standard_Boolean isCurvatureValid = Standard_False;" EOL
" Standard_Boolean isTan = aLProps.IsTangentDefined();" EOL
" // the tangent must be defined" EOL
" // to compute the curvature and the normal" EOL
" if (isTan)" EOL
" {" EOL
" aLProps.Tangent (aTangent);" EOL
" aCurvature = aLProps.Curvature();" EOL
" // the curvature must be non-null and finite" EOL
" // to compute the centre of curvature and the normal" EOL
" if (aCurvature > aResol && !Precision::IsInfinite(aCurvature))" EOL
" {" EOL
" isCurvatureValid = Standard_True;" EOL
" aLProps.CentreOfCurvature (aCentreOfCurvature);" EOL
" aLProps.Normal (aNormal);" EOL
" }" EOL
" }" EOL EOL
"//======================================" EOL;
setResultTitle (aTitle.ToCString());
setResultText (aText.ToCString());
// Display theCurve
drawCurve (theCurve);
Standard_Integer maxOrder = 3;
Standard_Real aResol = gp::Resolution();
GeomLProp_CLProps aLProps (theCurve, maxOrder, aResol);
Handle(AIS_InteractiveObject) aObjs[7];
for (int i=0; i < theNbPoints; i++)
{
if (WAIT_A_LITTLE)
return;
for (int j=0; j < sizeof(aObjs)/sizeof(Handle(AIS_InteractiveObject)); j++)
if (!aObjs[j].IsNull())
getAISContext()->Erase(aObjs[j]);
// define parameter at which properties should be computed
Standard_Real aParam;
aParam = thePoints[i];
// compute local properties
aLProps.SetParameter (aParam);
gp_Pnt aPnt = aLProps.Value();
gp_Vec aVecD1 = aLProps.D1();
gp_Vec aVecD2 = aLProps.D2();
gp_Vec aVecD3 = aLProps.D3();
gp_Dir aTangent, aNormal;
Standard_Real aCurvature;
gp_Pnt aCentreOfCurvature;
Standard_Boolean isCurvatureValid = Standard_False;
Standard_Boolean isTan = aLProps.IsTangentDefined();
// the tangent must be defined
// to compute the curvature and the normal
if (isTan)
{
aLProps.Tangent (aTangent);
aCurvature = aLProps.Curvature();
// the curvature must be non-null and finite
// to compute the centre of curvature and the normal
if (aCurvature > aResol && !Precision::IsInfinite(aCurvature))
{
isCurvatureValid = Standard_True;
aLProps.CentreOfCurvature (aCentreOfCurvature);
aLProps.Normal (aNormal);
}
}
// show results
aText += EOL " Results with parameter ";
aText += ASTR(thePoints[i]) + " :" EOL
"aPnt = (" + PRINT_COORDS(aPnt) + ")" EOL
"aVecD1 = (" + PRINT_COORDS(aVecD1) + ")" EOL
"aVecD2 = (" + PRINT_COORDS(aVecD2) + ")" EOL
"aVecD3 = (" + PRINT_COORDS(aVecD3) + ")" EOL;
if (isTan)
{
aText = aText +
"aTangent = (" + PRINT_COORDS(aTangent) + ")" EOL
"aCurvature = " + ASTR(aCurvature) + EOL;
if (isCurvatureValid)
{
aText = aText +
"aCentreOfCurvature = (" + PRINT_COORDS(aCentreOfCurvature) + ")" EOL
"aNormal = (" + PRINT_COORDS(aNormal) + ")" EOL;
}
}
else
aText += "Tangent is not defined" EOL;
setResultText (aText.ToCString());
// draw objects
aObjs[0] = drawPoint (aPnt);
aObjs[3] = drawVector (aPnt, aVecD3, D3Color);
aObjs[2] = drawVector (aPnt, aVecD2, D2Color);
aObjs[1] = drawVector (aPnt, aVecD1, D1Color);
if (isTan)
aObjs[4] = drawVector (aPnt, gp_Vec(aTangent)*50, TanColor);
if (isCurvatureValid)
{
aObjs[5] = drawVector (aPnt, gp_Vec(aNormal)*50, NormColor);
Handle(Geom_Circle) aCircle =
new Geom_Circle (gp_Ax2 (aCentreOfCurvature, aNormal^aTangent),
aCentreOfCurvature.Distance(aPnt));
aObjs[6] = drawCurve (aCircle, CrvtColor);
}
}
}
void LProps_Presentation::showSurfaceLProps (Handle(Geom_Surface) theSurface,
const Standard_CString theName,
const Standard_Integer theNbPoints,
const Standard_Real thePoints[][2])
{
TCollection_AsciiString aTitle ("Local properties of a ");
aTitle += theName;
TCollection_AsciiString aText;
aText = aText +
" // Create a " + theName + EOL
" Handle(Geom_" + theName + ") aSurface;" EOL
" // initialize aSurface" EOL
" // aSurface = ..." EOL EOL
" // define U and V parameters at which properties should be computed" EOL
" Standard_Real aUParam, aVParam;" EOL
" // aUParam = ..." EOL
" // aVParam = ..." EOL EOL
" // compute local properties" EOL
" Standard_Integer maxOrder = 2;" EOL
" Standard_Real aResol = gp::Resolution();" EOL
" GeomLProp_SLProps aLProps (theSurface, maxOrder, aResol);" EOL
" aLProps.SetParameters (aUParam, aVParam);" EOL
" gp_Pnt aPnt = aLProps.Value();" EOL
" gp_Vec aVecD1U = aLProps.D1U();" EOL
" gp_Vec aVecD1V = aLProps.D1V();" EOL
" gp_Vec aVecD2U = aLProps.D2U();" EOL
" gp_Vec aVecD2V = aLProps.D2V();" EOL
" gp_Vec aVecDUV = aLProps.DUV();" EOL
" gp_Dir aTangentU, aTangentV, aNormal, aMaxCurvD, aMinCurvD;" EOL
" Standard_Real aMaxCurvature, aMinCurvature, aMeanCurvature, aGausCurvature;" EOL
" // determine availability of properties" EOL
" Standard_Boolean isTanU = aLProps.IsTangentUDefined();" EOL
" Standard_Boolean isTanV = aLProps.IsTangentVDefined();" EOL
" Standard_Boolean isNormal = aLProps.IsNormalDefined();" EOL
" Standard_Boolean isCurvature = aLProps.IsCurvatureDefined();" EOL
" if (isTanU)" EOL
" aLProps.TangentU (aTangentU);" EOL
" if (isTanV)" EOL
" aLProps.TangentV (aTangentV);" EOL
" if (isNormal)" EOL
" aNormal = aLProps.Normal();" EOL
" if (isCurvature)" EOL
" {" EOL
" aMaxCurvature = aLProps.MaxCurvature();" EOL
" aMinCurvature = aLProps.MinCurvature();" EOL
" aGausCurvature = aLProps.GaussianCurvature();" EOL
" aMeanCurvature = aLProps.MeanCurvature();" EOL
" aLProps.CurvatureDirections (aMaxCurvD, aMinCurvD);" EOL
" }" EOL EOL
"//======================================" EOL;
setResultTitle (aTitle.ToCString());
setResultText (aText.ToCString());
// Display theSurface
drawSurface (theSurface);
Standard_Integer maxOrder = 2;
Standard_Real aResol = gp::Resolution();
GeomLProp_SLProps aLProps (theSurface, maxOrder, aResol);
Handle(AIS_InteractiveObject) aObjs[11];
for (int i=0; i < theNbPoints; i++)
{
if (WAIT_A_LITTLE)
return;
for (int j=0; j < sizeof(aObjs)/sizeof(Handle(AIS_InteractiveObject)); j++)
if (!aObjs[j].IsNull())
getAISContext()->Erase(aObjs[j]);
// define U and V parameters at which properties should be computed
Standard_Real aUParam, aVParam;
aUParam = thePoints[i][0];
aVParam = thePoints[i][1];
// compute local properties
aLProps.SetParameters (aUParam, aVParam);
gp_Pnt aPnt = aLProps.Value();
gp_Vec aVecD1U = aLProps.D1U();
gp_Vec aVecD1V = aLProps.D1V();
gp_Vec aVecD2U = aLProps.D2U();
gp_Vec aVecD2V = aLProps.D2V();
gp_Vec aVecDUV = aLProps.DUV();
gp_Dir aTangentU, aTangentV, aNormal, aMaxCurvD, aMinCurvD;
Standard_Real aMaxCurvature, aMinCurvature, aMeanCurvature, aGausCurvature;
// determine availability of properties
Standard_Boolean isTanU = aLProps.IsTangentUDefined();
Standard_Boolean isTanV = aLProps.IsTangentVDefined();
Standard_Boolean isNormal = aLProps.IsNormalDefined();
Standard_Boolean isCurvature = aLProps.IsCurvatureDefined();
if (isTanU)
aLProps.TangentU (aTangentU);
if (isTanV)
aLProps.TangentV (aTangentV);
if (isNormal)
aNormal = aLProps.Normal();
if (isCurvature)
{
aMaxCurvature = aLProps.MaxCurvature();
aMinCurvature = aLProps.MinCurvature();
aGausCurvature = aLProps.GaussianCurvature();
aMeanCurvature = aLProps.MeanCurvature();
aLProps.CurvatureDirections (aMaxCurvD, aMinCurvD);
}
// show results
aText = aText + EOL " Results with parameters "
"U=" + ASTR(thePoints[i][0]) + " V=" + ASTR(thePoints[i][1]) + " :" EOL
"aPnt = (" + PRINT_COORDS(aPnt) + ")" EOL
"aVecD1U = (" + PRINT_COORDS(aVecD1U) + ")" EOL
"aVecD1V = (" + PRINT_COORDS(aVecD1V) + ")" EOL
"aVecD2U = (" + PRINT_COORDS(aVecD2U) + ")" EOL
"aVecD2V = (" + PRINT_COORDS(aVecD2V) + ")" EOL
"aVecDUV = (" + PRINT_COORDS(aVecDUV) + ")" EOL;
if (isTanU)
aText = aText +
"aTangentU = (" + PRINT_COORDS(aTangentU) + ")" EOL;
if (isTanV)
aText = aText +
"aTangentV = (" + PRINT_COORDS(aTangentV) + ")" EOL;
if (isNormal)
aText = aText +
"aNormal = (" + PRINT_COORDS(aNormal) + ")" EOL;
if (isCurvature)
aText = aText +
"aMaxCurvature = " + ASTR(aMaxCurvature) + EOL
"aMinCurvature = " + ASTR(aMinCurvature) + EOL
"aMeanCurvature = " + ASTR(aMeanCurvature) + EOL
"aGausCurvature = " + ASTR(aGausCurvature) + EOL
"aMaxCurvD = (" + PRINT_COORDS(aMaxCurvD) + ")" EOL
"aMinCurvD = (" + PRINT_COORDS(aMinCurvD) + ")" EOL;
setResultText (aText.ToCString());
// draw objects
aObjs[0] = drawPoint (aPnt);
aObjs[3] = drawVector (aPnt, aVecD2U, D2Color);
aObjs[4] = drawVector (aPnt, aVecD2V, D2Color);
aObjs[1] = drawVector (aPnt, aVecD1U, D1Color);
aObjs[2] = drawVector (aPnt, aVecD1V, D1Color);
aObjs[5] = drawVector (aPnt, aVecDUV, D3Color);
if (isTanU)
aObjs[6] = drawVector (aPnt, gp_Vec(aTangentU)*50, TanColor);
if (isTanV)
aObjs[7] = drawVector (aPnt, gp_Vec(aTangentV)*50, TanColor);
if (isNormal)
aObjs[8] = drawVector (aPnt, gp_Vec(aNormal)*50, NormColor);
if (isCurvature)
{
aObjs[9] = drawVector (aPnt, gp_Vec(aMaxCurvD)*50, CrvtColor);
aObjs[10] = drawVector (aPnt, gp_Vec(aMinCurvD)*50, CrvtColor);
}
}
}

View File

@ -1,52 +0,0 @@
// LProps_Presentation.h: interface for the LProps_Presentation class.
// Presentation class: Local properties of curves and surfaces
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_LProps_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
#define AFX_LProps_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
#include <Geom2d_Curve.hxx>
class Quantity_Color;
class TopoDS_Wire;
class LProps_Presentation : public OCCDemo_Presentation
{
public:
// Construction
LProps_Presentation();
public:
// Iteration on samples
virtual void DoSample();
// one phase of iterations
private:
// Sample functions
void sampleBezier();
void samplePBSpline();
void sampleBezierSurface();
void showCurveLProps (Handle(Geom_Curve) theCurve,
const Standard_CString theName,
const Standard_Integer theNbPoints,
const Standard_Real thePoints[]);
// Draws the curve, shows local properties and updates the result dialog
void showSurfaceLProps (Handle(Geom_Surface) theSurface,
const Standard_CString theName,
const Standard_Integer theNbPoints,
const Standard_Real thePoints[][2]);
private:
// Array of pointers to sample functions
typedef void (LProps_Presentation::*PSampleFuncType)();
static const PSampleFuncType SampleFuncs[];
};
#endif // !defined(AFX_LProps_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)

View File

@ -1,237 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "All", "All\All.vcproj", "{CDD9C4AC-E63A-48C6-AF6A-7FD6370609B9}"
ProjectSection(ProjectDependencies) = postProject
{979F9F9B-5BCE-415C-9E8F-F871DED1AB40} = {979F9F9B-5BCE-415C-9E8F-F871DED1AB40}
{FA9B71A0-8AE0-4518-9B12-27E753015E00} = {FA9B71A0-8AE0-4518-9B12-27E753015E00}
{A49BF337-22E9-44C8-B634-676BEB5F558B} = {A49BF337-22E9-44C8-B634-676BEB5F558B}
{E959842A-7D24-4777-8976-0624FADCF4F4} = {E959842A-7D24-4777-8976-0624FADCF4F4}
{FBA9A30D-5DCB-47A2-A752-77A8D3069BF6} = {FBA9A30D-5DCB-47A2-A752-77A8D3069BF6}
{DF46376A-88B1-4595-B047-085F2F0AC9AD} = {DF46376A-88B1-4595-B047-085F2F0AC9AD}
{F6177F38-AD66-4D4A-8649-E6C720287DD1} = {F6177F38-AD66-4D4A-8649-E6C720287DD1}
{501CAB25-28D2-4524-82AF-94E28EB0C65E} = {501CAB25-28D2-4524-82AF-94E28EB0C65E}
{73DE3420-3017-4FA7-AA92-21CE03879C57} = {73DE3420-3017-4FA7-AA92-21CE03879C57}
{44D85FF3-8465-4B3A-9372-256BEB7121BC} = {44D85FF3-8465-4B3A-9372-256BEB7121BC}
{125F5E99-FCD1-43C9-8411-2C7C63B36553} = {125F5E99-FCD1-43C9-8411-2C7C63B36553}
{5D13CA3E-861D-44A0-AE78-912DA7B536ED} = {5D13CA3E-861D-44A0-AE78-912DA7B536ED}
{FD26F22D-3B50-40DF-A1A8-B87A1F88EF89} = {FD26F22D-3B50-40DF-A1A8-B87A1F88EF89}
{B2057EEF-2EC5-4792-82C3-CA9EC170CEEB} = {B2057EEF-2EC5-4792-82C3-CA9EC170CEEB}
{775D665A-FA15-4839-9FCC-D7BF490C50A7} = {775D665A-FA15-4839-9FCC-D7BF490C50A7}
{7DD966E8-5BE6-4065-92C9-5E5DB04BAD17} = {7DD966E8-5BE6-4065-92C9-5E5DB04BAD17}
{0E989051-BAAE-4697-A047-751615119042} = {0E989051-BAAE-4697-A047-751615119042}
{ABD21C66-622C-4F29-9602-0407E1C4904A} = {ABD21C66-622C-4F29-9602-0407E1C4904A}
{743FE249-592E-4FB5-A5A5-7066570C4797} = {743FE249-592E-4FB5-A5A5-7066570C4797}
{34A9BBD3-C9DE-413D-B151-D11F4658C22D} = {34A9BBD3-C9DE-413D-B151-D11F4658C22D}
{CFBE3134-E879-4618-B110-3D4A1BDD6931} = {CFBE3134-E879-4618-B110-3D4A1BDD6931}
{A63F4B63-6ACD-4BFB-BABA-975CDB68BE0C} = {A63F4B63-6ACD-4BFB-BABA-975CDB68BE0C}
{AB078051-5F96-432C-B5E6-578223C6E560} = {AB078051-5F96-432C-B5E6-578223C6E560}
{4C40F774-28C8-4AC0-9317-9052B891F15A} = {4C40F774-28C8-4AC0-9317-9052B891F15A}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Approx", "Approx\Approx.vcproj", "{4C40F774-28C8-4AC0-9317-9052B891F15A}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chamfers", "Chamfers\Chamfers.vcproj", "{AB078051-5F96-432C-B5E6-578223C6E560}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Convert", "Convert\Convert.vcproj", "{A63F4B63-6ACD-4BFB-BABA-975CDB68BE0C}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DCA", "DCA\DCA.vcproj", "{CFBE3134-E879-4618-B110-3D4A1BDD6931}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Extrema", "Extrema\Extrema.vcproj", "{34A9BBD3-C9DE-413D-B151-D11F4658C22D}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GProps", "GProps\GProps.vcproj", "{0E989051-BAAE-4697-A047-751615119042}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GeomConstraints", "GeomConstraints\GeomConstraints.vcproj", "{743FE249-592E-4FB5-A5A5-7066570C4797}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Glue", "Glue\Glue.vcproj", "{ABD21C66-622C-4F29-9602-0407E1C4904A}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HLR", "HLR\HLR.vcproj", "{7DD966E8-5BE6-4065-92C9-5E5DB04BAD17}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Interpol", "Interpol\Interpol.vcproj", "{775D665A-FA15-4839-9FCC-D7BF490C50A7}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Intersections", "Intersections\Intersections.vcproj", "{B2057EEF-2EC5-4792-82C3-CA9EC170CEEB}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LProps", "LProps\LProps.vcproj", "{FD26F22D-3B50-40DF-A1A8-B87A1F88EF89}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Offset2d", "Offset2d\Offset2d.vcproj", "{5D13CA3E-861D-44A0-AE78-912DA7B536ED}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PointOnCurve", "PointOnCurve\PointOnCurve.vcproj", "{125F5E99-FCD1-43C9-8411-2C7C63B36553}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Primitives", "Primitives\Primitives.vcproj", "{44D85FF3-8465-4B3A-9372-256BEB7121BC}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Projection", "Projection\Projection.vcproj", "{73DE3420-3017-4FA7-AA92-21CE03879C57}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Simplify", "Simplify\Simplify.vcproj", "{501CAB25-28D2-4524-82AF-94E28EB0C65E}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SplitShape", "SplitShape\SplitShape.vcproj", "{F6177F38-AD66-4D4A-8649-E6C720287DD1}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sweep", "Sweep\Sweep.vcproj", "{DF46376A-88B1-4595-B047-085F2F0AC9AD}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tesselate", "Tesselate\Tesselate.vcproj", "{FBA9A30D-5DCB-47A2-A752-77A8D3069BF6}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TexturesExt", "TexturesExt\TexturesExt.vcproj", "{E959842A-7D24-4777-8976-0624FADCF4F4}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ThruSections", "ThruSections\ThruSections.vcproj", "{A49BF337-22E9-44C8-B634-676BEB5F558B}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Transform", "Transform\Transform.vcproj", "{FA9B71A0-8AE0-4518-9B12-27E753015E00}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Validate", "Validate\Validate.vcproj", "{979F9F9B-5BCE-415C-9E8F-F871DED1AB40}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{CDD9C4AC-E63A-48C6-AF6A-7FD6370609B9}.Debug.ActiveCfg = Debug|Win32
{CDD9C4AC-E63A-48C6-AF6A-7FD6370609B9}.Debug.Build.0 = Debug|Win32
{CDD9C4AC-E63A-48C6-AF6A-7FD6370609B9}.Release.ActiveCfg = Release|Win32
{CDD9C4AC-E63A-48C6-AF6A-7FD6370609B9}.Release.Build.0 = Release|Win32
{4C40F774-28C8-4AC0-9317-9052B891F15A}.Debug.ActiveCfg = Debug|Win32
{4C40F774-28C8-4AC0-9317-9052B891F15A}.Debug.Build.0 = Debug|Win32
{4C40F774-28C8-4AC0-9317-9052B891F15A}.Release.ActiveCfg = Release|Win32
{4C40F774-28C8-4AC0-9317-9052B891F15A}.Release.Build.0 = Release|Win32
{AB078051-5F96-432C-B5E6-578223C6E560}.Debug.ActiveCfg = Debug|Win32
{AB078051-5F96-432C-B5E6-578223C6E560}.Debug.Build.0 = Debug|Win32
{AB078051-5F96-432C-B5E6-578223C6E560}.Release.ActiveCfg = Release|Win32
{AB078051-5F96-432C-B5E6-578223C6E560}.Release.Build.0 = Release|Win32
{A63F4B63-6ACD-4BFB-BABA-975CDB68BE0C}.Debug.ActiveCfg = Debug|Win32
{A63F4B63-6ACD-4BFB-BABA-975CDB68BE0C}.Debug.Build.0 = Debug|Win32
{A63F4B63-6ACD-4BFB-BABA-975CDB68BE0C}.Release.ActiveCfg = Release|Win32
{A63F4B63-6ACD-4BFB-BABA-975CDB68BE0C}.Release.Build.0 = Release|Win32
{CFBE3134-E879-4618-B110-3D4A1BDD6931}.Debug.ActiveCfg = Debug|Win32
{CFBE3134-E879-4618-B110-3D4A1BDD6931}.Debug.Build.0 = Debug|Win32
{CFBE3134-E879-4618-B110-3D4A1BDD6931}.Release.ActiveCfg = Release|Win32
{CFBE3134-E879-4618-B110-3D4A1BDD6931}.Release.Build.0 = Release|Win32
{34A9BBD3-C9DE-413D-B151-D11F4658C22D}.Debug.ActiveCfg = Debug|Win32
{34A9BBD3-C9DE-413D-B151-D11F4658C22D}.Debug.Build.0 = Debug|Win32
{34A9BBD3-C9DE-413D-B151-D11F4658C22D}.Release.ActiveCfg = Release|Win32
{34A9BBD3-C9DE-413D-B151-D11F4658C22D}.Release.Build.0 = Release|Win32
{0E989051-BAAE-4697-A047-751615119042}.Debug.ActiveCfg = Debug|Win32
{0E989051-BAAE-4697-A047-751615119042}.Debug.Build.0 = Debug|Win32
{0E989051-BAAE-4697-A047-751615119042}.Release.ActiveCfg = Release|Win32
{0E989051-BAAE-4697-A047-751615119042}.Release.Build.0 = Release|Win32
{743FE249-592E-4FB5-A5A5-7066570C4797}.Debug.ActiveCfg = Debug|Win32
{743FE249-592E-4FB5-A5A5-7066570C4797}.Debug.Build.0 = Debug|Win32
{743FE249-592E-4FB5-A5A5-7066570C4797}.Release.ActiveCfg = Release|Win32
{743FE249-592E-4FB5-A5A5-7066570C4797}.Release.Build.0 = Release|Win32
{ABD21C66-622C-4F29-9602-0407E1C4904A}.Debug.ActiveCfg = Debug|Win32
{ABD21C66-622C-4F29-9602-0407E1C4904A}.Debug.Build.0 = Debug|Win32
{ABD21C66-622C-4F29-9602-0407E1C4904A}.Release.ActiveCfg = Release|Win32
{ABD21C66-622C-4F29-9602-0407E1C4904A}.Release.Build.0 = Release|Win32
{7DD966E8-5BE6-4065-92C9-5E5DB04BAD17}.Debug.ActiveCfg = Debug|Win32
{7DD966E8-5BE6-4065-92C9-5E5DB04BAD17}.Debug.Build.0 = Debug|Win32
{7DD966E8-5BE6-4065-92C9-5E5DB04BAD17}.Release.ActiveCfg = Release|Win32
{7DD966E8-5BE6-4065-92C9-5E5DB04BAD17}.Release.Build.0 = Release|Win32
{775D665A-FA15-4839-9FCC-D7BF490C50A7}.Debug.ActiveCfg = Debug|Win32
{775D665A-FA15-4839-9FCC-D7BF490C50A7}.Debug.Build.0 = Debug|Win32
{775D665A-FA15-4839-9FCC-D7BF490C50A7}.Release.ActiveCfg = Release|Win32
{775D665A-FA15-4839-9FCC-D7BF490C50A7}.Release.Build.0 = Release|Win32
{B2057EEF-2EC5-4792-82C3-CA9EC170CEEB}.Debug.ActiveCfg = Debug|Win32
{B2057EEF-2EC5-4792-82C3-CA9EC170CEEB}.Debug.Build.0 = Debug|Win32
{B2057EEF-2EC5-4792-82C3-CA9EC170CEEB}.Release.ActiveCfg = Release|Win32
{B2057EEF-2EC5-4792-82C3-CA9EC170CEEB}.Release.Build.0 = Release|Win32
{FD26F22D-3B50-40DF-A1A8-B87A1F88EF89}.Debug.ActiveCfg = Debug|Win32
{FD26F22D-3B50-40DF-A1A8-B87A1F88EF89}.Debug.Build.0 = Debug|Win32
{FD26F22D-3B50-40DF-A1A8-B87A1F88EF89}.Release.ActiveCfg = Release|Win32
{FD26F22D-3B50-40DF-A1A8-B87A1F88EF89}.Release.Build.0 = Release|Win32
{5D13CA3E-861D-44A0-AE78-912DA7B536ED}.Debug.ActiveCfg = Debug|Win32
{5D13CA3E-861D-44A0-AE78-912DA7B536ED}.Debug.Build.0 = Debug|Win32
{5D13CA3E-861D-44A0-AE78-912DA7B536ED}.Release.ActiveCfg = Release|Win32
{5D13CA3E-861D-44A0-AE78-912DA7B536ED}.Release.Build.0 = Release|Win32
{125F5E99-FCD1-43C9-8411-2C7C63B36553}.Debug.ActiveCfg = Debug|Win32
{125F5E99-FCD1-43C9-8411-2C7C63B36553}.Debug.Build.0 = Debug|Win32
{125F5E99-FCD1-43C9-8411-2C7C63B36553}.Release.ActiveCfg = Release|Win32
{125F5E99-FCD1-43C9-8411-2C7C63B36553}.Release.Build.0 = Release|Win32
{44D85FF3-8465-4B3A-9372-256BEB7121BC}.Debug.ActiveCfg = Debug|Win32
{44D85FF3-8465-4B3A-9372-256BEB7121BC}.Debug.Build.0 = Debug|Win32
{44D85FF3-8465-4B3A-9372-256BEB7121BC}.Release.ActiveCfg = Release|Win32
{44D85FF3-8465-4B3A-9372-256BEB7121BC}.Release.Build.0 = Release|Win32
{73DE3420-3017-4FA7-AA92-21CE03879C57}.Debug.ActiveCfg = Debug|Win32
{73DE3420-3017-4FA7-AA92-21CE03879C57}.Debug.Build.0 = Debug|Win32
{73DE3420-3017-4FA7-AA92-21CE03879C57}.Release.ActiveCfg = Release|Win32
{73DE3420-3017-4FA7-AA92-21CE03879C57}.Release.Build.0 = Release|Win32
{501CAB25-28D2-4524-82AF-94E28EB0C65E}.Debug.ActiveCfg = Debug|Win32
{501CAB25-28D2-4524-82AF-94E28EB0C65E}.Debug.Build.0 = Debug|Win32
{501CAB25-28D2-4524-82AF-94E28EB0C65E}.Release.ActiveCfg = Release|Win32
{501CAB25-28D2-4524-82AF-94E28EB0C65E}.Release.Build.0 = Release|Win32
{F6177F38-AD66-4D4A-8649-E6C720287DD1}.Debug.ActiveCfg = Debug|Win32
{F6177F38-AD66-4D4A-8649-E6C720287DD1}.Debug.Build.0 = Debug|Win32
{F6177F38-AD66-4D4A-8649-E6C720287DD1}.Release.ActiveCfg = Release|Win32
{F6177F38-AD66-4D4A-8649-E6C720287DD1}.Release.Build.0 = Release|Win32
{DF46376A-88B1-4595-B047-085F2F0AC9AD}.Debug.ActiveCfg = Debug|Win32
{DF46376A-88B1-4595-B047-085F2F0AC9AD}.Debug.Build.0 = Debug|Win32
{DF46376A-88B1-4595-B047-085F2F0AC9AD}.Release.ActiveCfg = Release|Win32
{DF46376A-88B1-4595-B047-085F2F0AC9AD}.Release.Build.0 = Release|Win32
{FBA9A30D-5DCB-47A2-A752-77A8D3069BF6}.Debug.ActiveCfg = Debug|Win32
{FBA9A30D-5DCB-47A2-A752-77A8D3069BF6}.Debug.Build.0 = Debug|Win32
{FBA9A30D-5DCB-47A2-A752-77A8D3069BF6}.Release.ActiveCfg = Release|Win32
{FBA9A30D-5DCB-47A2-A752-77A8D3069BF6}.Release.Build.0 = Release|Win32
{E959842A-7D24-4777-8976-0624FADCF4F4}.Debug.ActiveCfg = Debug|Win32
{E959842A-7D24-4777-8976-0624FADCF4F4}.Debug.Build.0 = Debug|Win32
{E959842A-7D24-4777-8976-0624FADCF4F4}.Release.ActiveCfg = Release|Win32
{E959842A-7D24-4777-8976-0624FADCF4F4}.Release.Build.0 = Release|Win32
{A49BF337-22E9-44C8-B634-676BEB5F558B}.Debug.ActiveCfg = Debug|Win32
{A49BF337-22E9-44C8-B634-676BEB5F558B}.Debug.Build.0 = Debug|Win32
{A49BF337-22E9-44C8-B634-676BEB5F558B}.Release.ActiveCfg = Release|Win32
{A49BF337-22E9-44C8-B634-676BEB5F558B}.Release.Build.0 = Release|Win32
{FA9B71A0-8AE0-4518-9B12-27E753015E00}.Debug.ActiveCfg = Debug|Win32
{FA9B71A0-8AE0-4518-9B12-27E753015E00}.Debug.Build.0 = Debug|Win32
{FA9B71A0-8AE0-4518-9B12-27E753015E00}.Release.ActiveCfg = Release|Win32
{FA9B71A0-8AE0-4518-9B12-27E753015E00}.Release.Build.0 = Release|Win32
{979F9F9B-5BCE-415C-9E8F-F871DED1AB40}.Debug.ActiveCfg = Debug|Win32
{979F9F9B-5BCE-415C-9E8F-F871DED1AB40}.Debug.Build.0 = Debug|Win32
{979F9F9B-5BCE-415C-9E8F-F871DED1AB40}.Release.ActiveCfg = Release|Win32
{979F9F9B-5BCE-415C-9E8F-F871DED1AB40}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@ -1,428 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Offset2d"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../Debug"
IntermediateDirectory=".\../Debug/objd"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;WNT"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Debug/objd/Offset2d.pch"
AssemblerListingLocation=".\../Debug/objd/"
ObjectFile=".\../Debug/objd/"
ProgramDataBaseFileName=".\../Debug/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Debug/Offset2d.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\../Debug/Offset2d.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Debug/Offset2d.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\../Release"
IntermediateDirectory=".\../Release/obj"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WNT"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="StdAfx.h"
PrecompiledHeaderFile=".\../Release/obj/Offset2d.pch"
AssemblerListingLocation=".\../Release/obj/"
ObjectFile=".\../Release/obj/"
ProgramDataBaseFileName=".\../Release/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
OutputFile=".\../Release/Offset2d.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\../Release/Offset2d.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\../Release/Offset2d.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="Offset2d_Presentation.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="Offset2d_Presentation.h">
</File>
</Filter>
<Filter
Name="Common"
Filter="">
<File
RelativePath="..\env.bat">
</File>
<File
RelativePath="..\readme.txt">
</File>
<File
RelativePath="..\run.bat">
</File>
<File
RelativePath="..\vc.bat">
</File>
<Filter
Name="Source Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\MainFrm.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.rc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Common\WNT\StdAfx.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files No. 1"
Filter="">
<File
RelativePath="..\Common\ISession\ISession_Curve.h">
</File>
<File
RelativePath="..\Common\WNT\MainFrm.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemo.h">
</File>
<File
RelativePath="..\Common\OCCDemo_Presentation.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoDoc.h">
</File>
<File
RelativePath="..\Common\WNT\OCCDemoView.h">
</File>
<File
RelativePath="..\Common\WNT\resource.h">
</File>
<File
RelativePath="..\Common\WNT\ResultDialog.h">
</File>
<File
RelativePath="..\Common\WNT\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="..\Common\WNT\res\OCCDemo.ico">
</File>
<File
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar.bmp">
</File>
<File
RelativePath="..\Common\WNT\res\toolbar1.bmp">
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,427 +0,0 @@
// Offset2d_Presentation.cpp: implementation of the Offset2d_Presentation class.
// Presentation class: Offset of curves and wires
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Offset2d_Presentation.h"
#include <ISession_Curve.h>
#include <Geom2d_OffsetCurve.hxx>
#include <gp.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Ax2d.hxx>
#include <Quantity_Color.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Ellipse.hxx>
#include <Geom2d_Parabola.hxx>
#include <Geom2d_Hyperbola.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepOffsetAPI_MakeOffset.hxx>
#include <TopoDS_Wire.hxx>
// Initialization of global variable with an instance of this class
OCCDemo_Presentation* OCCDemo_Presentation::Current = new Offset2d_Presentation;
// Initialization of array of samples
const Offset2d_Presentation::SampleDescrType Offset2d_Presentation::SampleDescrs[] =
{
{&Offset2d_Presentation::sampleCircle, 4, -20, 4, 20},
{&Offset2d_Presentation::sampleEllipse, 4, -20, 4, 20},
{&Offset2d_Presentation::sampleParabola, 4, -20., 4, 20},
{&Offset2d_Presentation::sampleHyperbola, 4, -20., 4, 20},
//{&Offset2d_Presentation::sampleBezier, 4, -10, 4, 10},
{&Offset2d_Presentation::samplePBSpline, 4, -10, 8, 10},
{&Offset2d_Presentation::sampleWire1, 0, 0, 4, 10},
{&Offset2d_Presentation::sampleWire2, 4, -10, 3, 10}
};
// Colors of objects
static const Quantity_Color CurveColor (1,1,0, Quantity_TOC_RGB); // yellow
static const Quantity_Color OffsetCurveColor (1,0.647,0, Quantity_TOC_RGB); // orange
#ifdef WNT
#define EOL "\r\n"
#else
#define EOL "\n"
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Offset2d_Presentation::Offset2d_Presentation()
{
myNbSamples = sizeof(SampleDescrs)/sizeof(SampleDescrType);
setName ("Offset Curves");
}
//////////////////////////////////////////////////////////////////////
// Sample execution
//////////////////////////////////////////////////////////////////////
void Offset2d_Presentation::DoSample()
{
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbSamples)
(this->*SampleDescrs[myIndex].pFunc)();
}
//////////////////////////////////////////////////////////////////////
// Sample functions
//////////////////////////////////////////////////////////////////////
void Offset2d_Presentation::sampleCircle()
{
Standard_CString aName = "2d Circle";
// Create a Circle in 2d
gp_Pnt2d aOrigin (0,0);
gp_Dir2d aDir (1,0);
gp_Ax2d aAxis (aOrigin, aDir);
Standard_Real aRadius = 300;
Handle(Geom2d_Circle) aCurve = new Geom2d_Circle (aAxis, aRadius);
TCollection_AsciiString aText (
" // Create a Circle in 2d" EOL
" gp_Pnt2d aOrigin (0,0);" EOL
" gp_Dir2d aDir (1,0);" EOL
" gp_Ax2d aAxis (aOrigin, aDir);" EOL
" Standard_Real aRadius = 300;" EOL
" Handle(Geom2d_Circle) aCurve = new Geom2d_Circle (aAxis, aRadius);" EOL
);
drawAndOffsetCurve2d (aCurve, aName, aText);
}
void Offset2d_Presentation::sampleEllipse()
{
Standard_CString aName = "2d Ellipse";
// Create an Ellipse in 2d
gp_Pnt2d aOrigin (0,0);
gp_Dir2d aDir (1,0);
gp_Ax2d aMajorAxis (aOrigin, aDir);
Standard_Real aMajorRadius = 300;
Standard_Real aMinorRadius = 150;
Handle(Geom2d_Ellipse) aCurve =
new Geom2d_Ellipse (aMajorAxis, aMajorRadius, aMinorRadius);
TCollection_AsciiString aText (
" // Create an Ellipse in 2d" EOL
" gp_Pnt2d aOrigin (0,0);" EOL
" gp_Dir2d aDir (1,0);" EOL
" gp_Ax2d aMajorAxis (aOrigin, aDir);" EOL
" Standard_Real aMajorRadius = 300;" EOL
" Standard_Real aMinorRadius = 150;" EOL
" Handle(Geom2d_Ellipse) aCurve = " EOL
" new Geom2d_Ellipse (aMajorAxis, aMajorRadius, aMinorRadius);" EOL
);
drawAndOffsetCurve2d (aCurve, aName, aText);
}
void Offset2d_Presentation::sampleParabola()
{
Standard_CString aName = "2d Parabola";
// Create a Parabola in 2d
gp_Pnt2d aOrigin (0,0);
gp_Dir2d aDir (0,1);
gp_Ax2d aMirrorAxis (aOrigin, aDir);
Standard_Real aFocal = 100;
Handle(Geom2d_Parabola) aCurve =
new Geom2d_Parabola (aMirrorAxis, aFocal);
TCollection_AsciiString aText (
" // Create a Parabola in 2d" EOL
" gp_Pnt2d aOrigin (0,0);" EOL
" gp_Dir2d aDir (0,1);" EOL
" gp_Ax2d aMirrorAxis (aOrigin, aDir);" EOL
" Standard_Real aFocal = 100;" EOL
" Handle(Geom2d_Parabola) aCurve = " EOL
" new Geom2d_Parabola (aMirrorAxis, aFocal);" EOL
);
drawAndOffsetCurve2d (aCurve, aName, aText);
}
void Offset2d_Presentation::sampleHyperbola()
{
Standard_CString aName = "2d Hyperbola";
// Create a Hyperbola in 2d
gp_Pnt2d aOrigin (0,0);
gp_Dir2d aDir (1,1);
gp_Ax2d aMajorAxis (aOrigin, aDir);
Standard_Real aMajorRadius = 100;
Standard_Real aMinorRadius = 100;
Handle(Geom2d_Hyperbola) aCurve =
new Geom2d_Hyperbola (aMajorAxis, aMajorRadius, aMinorRadius);
TCollection_AsciiString aText (
" // Create a Hyperbola in 2d" EOL
" gp_Pnt2d aOrigin (0,0);" EOL
" gp_Dir2d aDir (1,1);" EOL
" gp_Ax2d aMajorAxis (aOrigin, aDir);" EOL
" Standard_Real aMajorRadius = 100;" EOL
" Standard_Real aMinorRadius = 100;" EOL
" Handle(Geom2d_Hyperbola) aCurve = " EOL
" new Geom2d_Hyperbola (aMajorAxis, aMajorRadius, aMinorRadius);" EOL
);
drawAndOffsetCurve2d (aCurve, aName, aText);
}
void Offset2d_Presentation::sampleBezier()
{
Standard_CString aName = "2d BezierCurve";
// Create a BezierCurve in 2d
Standard_Real aPolesCoords[][2] = {
{0,0},{0,1},{1,1},{1,2},{2,2},{2,1},{3,1},{3,0},{2,0},{2,-1},
{3,-1},{3,-2},{4,-2},{4,-1},{5,-1},{5,0},{6,0},{6,-1},{7,-1},
{7,0},{8,0},{8,1},{7,1},{7,2},{6,2},{6,1},{5,1}
};
TColgp_Array1OfPnt2d aPoles (1, sizeof(aPolesCoords)/(sizeof(Standard_Real)*2));
for (Standard_Integer i=1; i <= aPoles.Upper(); i++)
aPoles(i) = gp_Pnt2d (aPolesCoords[i-1][0]*100, aPolesCoords[i-1][1]*100);
Handle(Geom2d_BezierCurve) aCurve =
new Geom2d_BezierCurve (aPoles);
TCollection_AsciiString aText (
" // Create a BezierCurve in 2d" EOL
" Standard_Real aPolesCoords[][2] = {" EOL
" {0,0},{0,1},{1,1},{1,2},{2,2},{2,1},{3,1},{3,0},{2,0},{2,-1}," EOL
" {3,-1},{3,-2},{4,-2},{4,-1},{5,-1},{5,0},{6,0},{6,-1},{7,-1}," EOL
" {7,0},{8,0},{8,1},{7,1},{7,2},{6,2},{6,1},{5,1}" EOL
" };" EOL
" TColgp_Array1OfPnt2d aPoles (1, sizeof(aPolesCoords)/(sizeof(Standard_Real)*2));" EOL
" " EOL
" for (Standard_Integer i=1; i <= aPoles.Upper(); i++)" EOL
" aPoles(i) = gp_Pnt2d (aPolesCoords[i-1][0]*100, aPolesCoords[i-1][1]*100);" EOL
" " EOL
" Handle(Geom2d_BezierCurve) aCurve = " EOL
" new Geom2d_BezierCurve (aPoles);" EOL
);
drawAndOffsetCurve2d (aCurve, aName, aText);
}
void Offset2d_Presentation::samplePBSpline()
{
Standard_CString aName = "2d BSplineCurve";
// Create a Periodic BSplineCurve in 2d
Standard_Real aPolesCoords[][2] = {
{0,0},{0,1},{1,1},{1,0},{2,0},{2,-1},{1,-1},
{1,-2},{0,-2},{0,-1},{-1,-1},{-1,0}
};
Standard_Integer nPoles = sizeof(aPolesCoords)/(sizeof(Standard_Real)*2);
TColgp_Array1OfPnt2d aPoles (1, nPoles);
TColStd_Array1OfReal aKnots (1, nPoles+1);
TColStd_Array1OfInteger aMultiplicities(1, nPoles+1);
const Standard_Integer aDegree = 3;
const Standard_Boolean isPeriodic = Standard_True;
for (Standard_Integer i=1; i <= aPoles.Upper(); i++)
aPoles(i) = gp_Pnt2d (aPolesCoords[i-1][0]*100, aPolesCoords[i-1][1]*100);
for (i=1; i <= aKnots.Upper(); i++)
aKnots(i) = i-1;
aMultiplicities.Init(1);
Handle(Geom2d_BSplineCurve) aCurve =
new Geom2d_BSplineCurve (aPoles, aKnots, aMultiplicities, aDegree, isPeriodic);
TCollection_AsciiString aText (
" // Create a Periodic BSplineCurve in 2d" EOL
" Standard_Real aPolesCoords[][2] = {" EOL
" {0,0},{0,1},{1,1},{1,0},{2,0},{2,-1},{1,-1}," EOL
" {1,-2},{0,-2},{0,-1},{-1,-1},{-1,0}" EOL
" };" EOL
" Standard_Integer nPoles = sizeof(aPolesCoords)/(sizeof(Standard_Real)*2);" EOL
" TColgp_Array1OfPnt2d aPoles (1, nPoles);" EOL
" TColStd_Array1OfReal aKnots (1, nPoles+1);" EOL
" TColStd_Array1OfInteger aMultiplicities(1, nPoles+1);" EOL
" const Standard_Integer aDegree = 3;" EOL
" const Standard_Boolean isPeriodic = Standard_True;" EOL
"" EOL
" for (Standard_Integer i=1; i <= aPoles.Upper(); i++)" EOL
" aPoles(i) = gp_Pnt2d (aPolesCoords[i-1][0]*100, aPolesCoords[i-1][1]*100);" EOL
" for (i=1; i <= aKnots.Upper(); i++)" EOL
" aKnots(i) = i-1;" EOL
" aMultiplicities.Init(1);" EOL
"" EOL
" Handle(Geom2d_BSplineCurve) aCurve = " EOL
" new Geom2d_BSplineCurve (aPoles, aKnots, aMultiplicities, aDegree, isPeriodic);" EOL
);
drawAndOffsetCurve2d (aCurve, aName, aText);
}
void Offset2d_Presentation::sampleWire1()
{
Standard_CString aName = "Wire 1";
// Create an open polyline wire
Standard_Real aCoords[][3] = {
{0,0,0},{0,1,0},{1,1,0},{1,2,0},{2,2,0},{2,1,0},{3,1,0},{3,0,0},
{2,0,0},{2,-1,0},{3,-1,0},{3,-2,0},{4,-2,0},{4,-1,0},{5,-1,0},
{5,0,0},{6,0,0},{6,-1,0},{7,-1,0},{7,0,0},{8,0,0},{8,1,0},
{7,1,0},{7,2,0},{6,2,0},{6,1,0},{5,1,0}
};
Standard_Integer nPoints = sizeof(aCoords)/(sizeof(Standard_Real)*3);
BRepBuilderAPI_MakePolygon aPol;
for (Standard_Integer i=0; i < nPoints; i++)
aPol.Add (gp_Pnt (aCoords[i][0]*100, aCoords[i][1]*100, aCoords[i][2]*100));
TopoDS_Wire aWire = aPol.Wire();
TCollection_AsciiString aText (
" // Create an open polyline wire" EOL
" Standard_Real aCoords[][3] = {" EOL
" {0,0,0},{0,1,0},{1,1,0},{1,2,0},{2,2,0},{2,1,0},{3,1,0},{3,0,0}," EOL
" {2,0,0},{2,-1,0},{3,-1,0},{3,-2,0},{4,-2,0},{4,-1,0},{5,-1,0}," EOL
" {5,0,0},{6,0,0},{6,-1,0},{7,-1,0},{7,0,0},{8,0,0},{8,1,0}," EOL
" {7,1,0},{7,2,0},{6,2,0},{6,1,0},{5,1,0}" EOL
" };" EOL
" Standard_Integer nPoints = sizeof(aCoords)/(sizeof(Standard_Real)*3);" EOL
" BRepBuilderAPI_MakePolygon aPol;" EOL
" for (Standard_Integer i=0; i < nPoints; i++)" EOL
" aPol.Add (gp_Pnt (aCoords[i][0]*100, aCoords[i][1]*100, aCoords[i][2]*100));" EOL
" TopoDS_Wire aWire = aPol.Wire();" EOL
);
drawAndOffsetWire (aWire, aName, aText);
}
void Offset2d_Presentation::sampleWire2()
{
Standard_CString aName = "Wire 2";
// Create a closed polyline wire
Standard_Real aCoords[][3] = {
{0,0,0},{0,1,0},{1,1,0},{1,0,0},{2,0,0},{2,-1,0},{1,-1,0},
{1,-2,0},{0,-2,0},{0,-1,0},{-1,-1,0},{-1,0,0},{0,0,0}
};
Standard_Integer nPoints = sizeof(aCoords)/(sizeof(Standard_Real)*3);
BRepBuilderAPI_MakePolygon aPol;
for (Standard_Integer i=0; i < nPoints; i++)
aPol.Add (gp_Pnt (aCoords[i][0]*100, aCoords[i][1]*100, aCoords[i][2]*100));
TopoDS_Wire aWire = aPol.Wire();
TCollection_AsciiString aText (
" // Create a closed polyline wire" EOL
" Standard_Real aCoords[][3] = {" EOL
" {0,0,0},{0,1,0},{1,1,0},{1,0,0},{2,0,0},{2,-1,0},{1,-1,0}," EOL
" {1,-2,0},{0,-2,0},{0,-1,0},{-1,-1,0},{-1,0,0},{0,0,0}" EOL
" };" EOL
" Standard_Integer nPoints = sizeof(aCoords)/(sizeof(Standard_Real)*3);" EOL
" BRepBuilderAPI_MakePolygon aPol;" EOL
" for (Standard_Integer i=0; i < nPoints; i++)" EOL
" aPol.Add (gp_Pnt (aCoords[i][0]*100, aCoords[i][1]*100, aCoords[i][2]*100));" EOL
" TopoDS_Wire aWire = aPol.Wire();" EOL
);
drawAndOffsetWire (aWire, aName, aText);
}
void Offset2d_Presentation::drawAndOffsetCurve2d (Handle(Geom2d_Curve) theCurve,
const Standard_CString theName,
TCollection_AsciiString& theText)
{
TCollection_AsciiString aTitle ("Offset to ");
aTitle += theName;
theText += EOL;
theText += " // Make an offset curve" EOL;
theText += " Standard_Real aDist = ";
theText += TCollection_AsciiString (SampleDescrs[myIndex].dPos);
theText += ";" EOL;
theText += " Handle(Geom2d_OffsetCurve) aOffCurve =" EOL;
theText += " new Geom2d_OffsetCurve (aCurve, aDist);" EOL;
setResultTitle (aTitle.ToCString());
setResultText (theText.ToCString());
// Display theCurve
drawCurve (theCurve, CurveColor);
getViewer()->InitActiveViews();
getViewer()->ActiveView()->FitAll();
getViewer()->ActiveView()->Update();
// Make offset curves
Handle(AIS_InteractiveObject) aObj;
for (int i=1; i <= SampleDescrs[myIndex].nNeg; i++)
{
if (WAIT_A_LITTLE)
return;
if (!aObj.IsNull())
getAISContext()->Erase(aObj);
Standard_Real aDist = SampleDescrs[myIndex].dNeg * i;
Handle(Geom2d_OffsetCurve) aOffCurve = new Geom2d_OffsetCurve (theCurve, aDist);
aObj = drawCurve (aOffCurve, OffsetCurveColor);
}
for (i=1; i <= SampleDescrs[myIndex].nPos; i++)
{
if (WAIT_A_LITTLE)
return;
if (!aObj.IsNull())
getAISContext()->Erase(aObj);
Standard_Real aDist = SampleDescrs[myIndex].dPos * i;
Handle(Geom2d_OffsetCurve) aOffCurve = new Geom2d_OffsetCurve (theCurve, aDist);
aObj = drawCurve (aOffCurve, OffsetCurveColor);
}
}
void Offset2d_Presentation::drawAndOffsetWire(const TopoDS_Wire& theWire,
const Standard_CString theName,
TCollection_AsciiString& theText)
{
TCollection_AsciiString aTitle ("Offset to ");
aTitle += theName;
theText += EOL;
theText += " // Make an offset shape" EOL;
theText += " Standard_Real aDist = ";
theText += TCollection_AsciiString (SampleDescrs[myIndex].dPos);
theText += ";" EOL;
theText += " BRepOffsetAPI_MakeOffset aOffAlgo (aWire, GeomAbs_Arc);" EOL;
theText += " aOffAlgo.Perform (aDist);" EOL;
theText += " if (aOffAlgo.IsDone())" EOL;
theText += " TopoDS_Shape aOffShape = aOffAlgo.Shape();" EOL;
setResultTitle (aTitle.ToCString());
setResultText (theText.ToCString());
// Display theWire
Handle(AIS_InteractiveObject) aObj = new AIS_Shape (theWire);
getAISContext()->SetColor (aObj, CurveColor);
getAISContext()->Display (aObj);
getViewer()->InitActiveViews();
getViewer()->ActiveView()->FitAll();
getViewer()->ActiveView()->Update();
// Make offset shapes
aObj.Nullify();
for (int i=1; i <= SampleDescrs[myIndex].nNeg; i++)
{
if (WAIT_A_LITTLE)
return;
if (!aObj.IsNull())
getAISContext()->Erase(aObj);
Standard_Real aDist = SampleDescrs[myIndex].dNeg * i;
BRepOffsetAPI_MakeOffset aOffAlgo (theWire, GeomAbs_Arc);
aOffAlgo.Perform (aDist);
if (aOffAlgo.IsDone())
{
TopoDS_Shape aOffShape = aOffAlgo.Shape();
aObj = new AIS_Shape (aOffShape);
getAISContext()->SetColor (aObj, OffsetCurveColor);
getAISContext()->Display (aObj);
}
}
for (i=1; i <= SampleDescrs[myIndex].nPos; i++)
{
if (WAIT_A_LITTLE)
return;
if (!aObj.IsNull())
getAISContext()->Erase(aObj);
Standard_Real aDist = SampleDescrs[myIndex].dPos * i;
BRepOffsetAPI_MakeOffset aOffAlgo (theWire, GeomAbs_Arc);
aOffAlgo.Perform (aDist);
if (aOffAlgo.IsDone())
{
TopoDS_Shape aOffShape = aOffAlgo.Shape();
aObj = new AIS_Shape (aOffShape);
getAISContext()->SetColor (aObj, OffsetCurveColor);
getAISContext()->Display (aObj);
}
}
}

Some files were not shown because too many files have changed in this diff Show More