mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
48
samples/mfc/standard/02_Modeling/src/ISession_Direction.cpp
Executable file
48
samples/mfc/standard/02_Modeling/src/ISession_Direction.cpp
Executable file
@@ -0,0 +1,48 @@
|
||||
// ISession_Direction.cpp: implementation of the ISession_Direction class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ISession_Direction.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[]=__FILE__;
|
||||
#endif
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE(ISession_Direction,AIS_InteractiveObject)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
|
||||
|
||||
#include "DsgPrs_LengthPresentation.hxx"
|
||||
#include "Prs3d_ArrowAspect.hxx"
|
||||
#include "AIS_Drawer.hxx"
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
ISession_Direction::ISession_Direction(gp_Pnt& aPnt,gp_Pnt& aPnt2)
|
||||
:myStartPnt(aPnt),myEndPnt(aPnt2)
|
||||
{}
|
||||
|
||||
ISession_Direction::ISession_Direction(gp_Pnt& aPnt,gp_Vec& aVec)
|
||||
:myStartPnt(aPnt)
|
||||
{
|
||||
myEndPnt = myStartPnt.Translated(aVec);
|
||||
}
|
||||
|
||||
|
||||
void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
|
||||
const Handle(Prs3d_Presentation)& aPresentation,
|
||||
const Standard_Integer aMode)
|
||||
{
|
||||
Handle(Prs3d_ArrowAspect) anArrowAspect = myDrawer->ArrowAspect();
|
||||
anArrowAspect->SetLength(myStartPnt.Distance(myEndPnt));
|
||||
myDrawer->SetArrowAspect(anArrowAspect);
|
||||
|
||||
DsgPrs_LengthPresentation::Add(aPresentation,myDrawer,
|
||||
myStartPnt,myEndPnt,
|
||||
DsgPrs_AS_LASTAR);
|
||||
}
|
||||
|
||||
|
39
samples/mfc/standard/02_Modeling/src/ISession_Direction.h
Executable file
39
samples/mfc/standard/02_Modeling/src/ISession_Direction.h
Executable file
@@ -0,0 +1,39 @@
|
||||
// ISession_Direction.h: interface for the ISession_Direction class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_ISession_Direction_H__767C0DB3_A3B0_11D1_8DA3_0800369C8A03__INCLUDED_)
|
||||
#define AFX_ISession_Direction_H__767C0DB3_A3B0_11D1_8DA3_0800369C8A03__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
|
||||
#include "gp_Dir.hxx"
|
||||
#include "gp_Vec.hxx"
|
||||
#include "AIS_InteractiveObject.hxx"
|
||||
|
||||
DEFINE_STANDARD_HANDLE(ISession_Direction,AIS_InteractiveObject)
|
||||
class ISession_Direction : public AIS_InteractiveObject
|
||||
{
|
||||
public:
|
||||
ISession_Direction();
|
||||
ISession_Direction(gp_Pnt& aPnt,gp_Pnt& aPnt2);
|
||||
ISession_Direction(gp_Pnt& aPnt,gp_Vec& aVec);
|
||||
|
||||
DEFINE_STANDARD_RTTI(ISession_Direction)
|
||||
|
||||
private:
|
||||
|
||||
void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
|
||||
const Handle(Prs3d_Presentation)& aPresentation,
|
||||
const Standard_Integer aMode);
|
||||
void ComputeSelection(const class Handle_SelectMgr_Selection &,const int){};
|
||||
gp_Pnt myStartPnt;
|
||||
gp_Pnt myEndPnt;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_ISession_Direction_H__767C0DB3_A3B0_11D1_8DA3_0800369C8A03__INCLUDED_)
|
87
samples/mfc/standard/02_Modeling/src/ModelingApp.cpp
Executable file
87
samples/mfc/standard/02_Modeling/src/ModelingApp.cpp
Executable file
@@ -0,0 +1,87 @@
|
||||
// ModelingApp.cpp : Defines the class behaviors for the application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "..\res\resource.h"
|
||||
|
||||
#include "ModelingApp.h"
|
||||
|
||||
#include "OCC_MainFrame.h"
|
||||
#include "OCC_3dChildFrame.h"
|
||||
#include "ModelingDoc.h"
|
||||
#include "OCC_3dView.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CModelingApp construction
|
||||
|
||||
CModelingApp::CModelingApp()
|
||||
{
|
||||
SampleName = "Modeling"; //for about dialog
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CModelingApp object
|
||||
|
||||
CModelingApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CModelingApp initialization
|
||||
|
||||
BOOL CModelingApp::InitInstance()
|
||||
{
|
||||
AfxEnableControlContainer();
|
||||
|
||||
// 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.
|
||||
|
||||
// Change the registry key under which our settings are stored.
|
||||
// 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.
|
||||
|
||||
CMultiDocTemplate* pDocTemplate;
|
||||
pDocTemplate = new CMultiDocTemplate(
|
||||
IDR_3DTYPE,
|
||||
RUNTIME_CLASS(CModelingDoc),
|
||||
RUNTIME_CLASS(OCC_3dChildFrame), // custom MDI child frame
|
||||
RUNTIME_CLASS(OCC_3dView));
|
||||
AddDocTemplate(pDocTemplate);
|
||||
|
||||
// create main MDI Frame window
|
||||
OCC_MainFrame* pMainFrame = new OCC_MainFrame(with_AIS_TB);
|
||||
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
|
||||
return FALSE;
|
||||
m_pMainWnd = pMainFrame;
|
||||
// Create additional toolbar
|
||||
m_pToolBar2 = new CToolBar;
|
||||
if ( !m_pToolBar2->Create(m_pMainWnd, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS) ||
|
||||
!m_pToolBar2->LoadToolBar(IDR_FRAME2))
|
||||
{
|
||||
TRACE0("Failed to create toolbar\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
// 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;
|
||||
|
||||
// The main window has been initialized, so show and update it.
|
||||
pMainFrame->ShowWindow(m_nCmdShow);
|
||||
pMainFrame->UpdateWindow();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
33
samples/mfc/standard/02_Modeling/src/ModelingApp.h
Executable file
33
samples/mfc/standard/02_Modeling/src/ModelingApp.h
Executable file
@@ -0,0 +1,33 @@
|
||||
// ModelingApp.h : main header file for the TOPOLOGYTRANSFORMATIONS application
|
||||
//
|
||||
|
||||
#if !defined(AFX_MODELINGAPP_H__30453388_3E75_11D7_8611_0060B0EE281E__INCLUDED_)
|
||||
#define AFX_MODELINGAPP_H__30453388_3E75_11D7_8611_0060B0EE281E__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include <OCC_3dApp.h>
|
||||
|
||||
class CModelingApp : public OCC_3dApp
|
||||
{
|
||||
public:
|
||||
CModelingApp();
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CModelingApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
private:
|
||||
CToolBar *m_pToolBar2;
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MODELINGAPP_H__30453388_3E75_11D7_8611_0060B0EE281E__INCLUDED_)
|
5073
samples/mfc/standard/02_Modeling/src/ModelingDoc.cpp
Executable file
5073
samples/mfc/standard/02_Modeling/src/ModelingDoc.cpp
Executable file
File diff suppressed because it is too large
Load Diff
99
samples/mfc/standard/02_Modeling/src/ModelingDoc.h
Executable file
99
samples/mfc/standard/02_Modeling/src/ModelingDoc.h
Executable file
@@ -0,0 +1,99 @@
|
||||
// ModelingDoc.h : interface of the CModelingDoc class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MODELINGDOC_H__30453389_3E75_11D7_8611_0060B0EE281E__INCLUDED_)
|
||||
#define AFX_MODELINGDOC_H__30453389_3E75_11D7_8611_0060B0EE281E__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include <OCC_3dDoc.h>
|
||||
|
||||
class CModelingDoc : public OCC_3dDoc
|
||||
{
|
||||
|
||||
protected: // create from serialization only
|
||||
CModelingDoc();
|
||||
DECLARE_DYNCREATE(CModelingDoc)
|
||||
|
||||
public:
|
||||
virtual ~CModelingDoc();
|
||||
|
||||
void InputEvent (const Standard_Integer x ,
|
||||
const Standard_Integer y ,
|
||||
const Handle(V3d_View)& aView );
|
||||
void Popup (const Standard_Integer x ,
|
||||
const Standard_Integer y ,
|
||||
const Handle(V3d_View)& aView );
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CModelingDoc)
|
||||
afx_msg void OnMirror();
|
||||
afx_msg void OnMirroraxis();
|
||||
afx_msg void OnRotate();
|
||||
afx_msg void OnScale();
|
||||
afx_msg void OnTranslation();
|
||||
afx_msg void OnDisplacement();
|
||||
afx_msg void OnDeform();
|
||||
afx_msg void OnBox();
|
||||
afx_msg void OnCylinder();
|
||||
afx_msg void OnCone();
|
||||
afx_msg void OnSphere();
|
||||
afx_msg void OnTorus();
|
||||
afx_msg void OnWedge();
|
||||
afx_msg void OnPrism();
|
||||
afx_msg void OnRevol();
|
||||
afx_msg void OnPipe();
|
||||
afx_msg void OnThru();
|
||||
afx_msg void OnEvolved();
|
||||
afx_msg void OnDraft();
|
||||
afx_msg void OnCut();
|
||||
afx_msg void OnFuse();
|
||||
afx_msg void OnSection();
|
||||
afx_msg void OnCommon();
|
||||
afx_msg void OnPsection();
|
||||
afx_msg void OnBlend();
|
||||
afx_msg void OnChamf();
|
||||
afx_msg void OnEvolvedblend();
|
||||
afx_msg void OnPrismLocal();
|
||||
afx_msg void OnRevolLocal();
|
||||
afx_msg void OnGlueLocal();
|
||||
afx_msg void OnDprismLocal();
|
||||
afx_msg void OnPipeLocal();
|
||||
afx_msg void OnLinearLocal();
|
||||
afx_msg void OnSplitLocal();
|
||||
afx_msg void OnThickLocal();
|
||||
afx_msg void OnOffsetLocal();
|
||||
afx_msg void OnVertex();
|
||||
afx_msg void OnEdge();
|
||||
afx_msg void OnWire();
|
||||
afx_msg void OnFace();
|
||||
afx_msg void OnShell();
|
||||
afx_msg void OnCompound();
|
||||
afx_msg void OnGeometrie();
|
||||
afx_msg void OnSewing();
|
||||
afx_msg void OnExplorer();
|
||||
afx_msg void OnBuilder();
|
||||
afx_msg void OnValid();
|
||||
afx_msg void OnLinear();
|
||||
afx_msg void OnVolume();
|
||||
afx_msg void OnSurface();
|
||||
afx_msg void OnFillwithtang();
|
||||
afx_msg void OnButtonFill();
|
||||
afx_msg void OnStopStop();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
public:
|
||||
int myState;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MODELINGDOC_H__30453389_3E75_11D7_8611_0060B0EE281E__INCLUDED_)
|
6
samples/mfc/standard/02_Modeling/src/State.h
Executable file
6
samples/mfc/standard/02_Modeling/src/State.h
Executable file
@@ -0,0 +1,6 @@
|
||||
enum STATE {
|
||||
SELECT_EDGE_PLATE,
|
||||
SELECT_EDGE_PLATE_TGTES_1,
|
||||
SELECT_EDGE_PLATE_TGTES_2,
|
||||
SELECT_EDGE_PLATE_TGTES_3
|
||||
};
|
7
samples/mfc/standard/02_Modeling/src/StdAfx.cpp
Executable file
7
samples/mfc/standard/02_Modeling/src/StdAfx.cpp
Executable file
@@ -0,0 +1,7 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// SampleTopologyTransformations.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
|
138
samples/mfc/standard/02_Modeling/src/StdAfx.h
Executable file
138
samples/mfc/standard/02_Modeling/src/StdAfx.h
Executable file
@@ -0,0 +1,138 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#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 <afxdisp.h> // MFC OLE automation classes
|
||||
#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 <Graphic3d_WNTGraphicDevice.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <WNT_Window.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <BRepPrimAPI_MakeWedge.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Elips.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <AIS_Axis.hxx>
|
||||
#include <BRepBuilderAPI_Transform.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <AIS_Plane.hxx>
|
||||
#include <AIS_Line.hxx>
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <AIS_ConnectedInteractive.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_Axis1Placement.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Transformation.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <BRepBuilderAPI_GTransform.hxx>
|
||||
#include <BRepPrimAPI_MakeBox.hxx>
|
||||
#include <BRepPrimAPI_MakeCone.hxx>
|
||||
#include <BRepPrimAPI_MakeSphere.hxx>
|
||||
#include <BRepPrimAPI_MakePrism.hxx>
|
||||
#include <BRepPrimAPI_MakeTorus.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||
#include <BRepBuilderAPI_MakePolygon.hxx>
|
||||
#include <BRepBuilderAPI_MakeShell.hxx>
|
||||
#include <BRepPrimAPI_MakeRevol.hxx>
|
||||
#include <BRepOffsetAPI_MakePipe.hxx>
|
||||
#include <BRepOffsetAPI_ThruSections.hxx>
|
||||
#include <BRepOffsetAPI_MakeEvolved.hxx>
|
||||
#include <BRepOffsetAPI_DraftAngle.hxx>
|
||||
#include <BRepOffsetAPI_Sewing.hxx>
|
||||
#include <BRepGProp.hxx>
|
||||
#include <BRepAlgo.hxx>
|
||||
#include <BRepAlgoAPI_Cut.hxx>
|
||||
#include <BRepAlgoAPI_Fuse.hxx>
|
||||
#include <BRepAlgoAPI_Common.hxx>
|
||||
#include <BRepAlgoAPI_Section.hxx>
|
||||
#include <BRepFilletAPI_MakeFillet.hxx>
|
||||
#include <BRepFilletAPI_MakeChamfer.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TopOpeBRepTool.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <GCE2d_MakeLine.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepFeat_MakePrism.hxx>
|
||||
#include <BRepFeat_MakeDPrism.hxx>
|
||||
#include <BRepFeat_MakeRevol.hxx>
|
||||
#include <BRepFeat_Gluer.hxx>
|
||||
#include <BRepFeat_MakePipe.hxx>
|
||||
#include <BRepFeat_MakeLinearForm.hxx>
|
||||
#include <BRepFeat_SplitShape.hxx>
|
||||
#include <BRepOffsetAPI_MakeThickSolid.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <GeomAPI_PointsToBSplineSurface.hxx>
|
||||
#include <GeomAPI_PointsToBSpline.hxx>
|
||||
#include <GeomFill_BSplineCurves.hxx>
|
||||
#include <LocOpe_FindEdges.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <GeomPlate_HArray1OfHCurveOnSurface.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <BRepAdaptor_HCurve2d.hxx>
|
||||
#include <GeomPlate_BuildPlateSurface.hxx>
|
||||
#include <GeomPlate_MakeApprox.hxx>
|
||||
#include <TopTools_Array1OfShape.hxx>
|
||||
#include <TColGeom2d_HArray1OfCurve.hxx>
|
||||
#include <BRepTopAdaptor_FClass2d.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
#include <GeomPlate_BuildAveragePlane.hxx>
|
||||
#include <Plate_PinpointConstraint.hxx>
|
||||
#include <Plate_D1.hxx>
|
||||
#include <Plate_GtoCConstraint.hxx>
|
||||
#include <GeomPlate_Surface.hxx>
|
||||
#include <GeomProjLib.hxx>
|
||||
#include <GCE2d_MakeSegment.hxx>
|
||||
|
||||
#include "ISession_Direction.h"
|
||||
|
||||
#include <UnitsAPI.hxx>
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
Reference in New Issue
Block a user