1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

..

198 Commits

Author SHA1 Message Date
nds
87e7c67105 0032077: Visualization - setting custom default frame buffer object for OpenGl context 2021-01-22 17:47:30 +03:00
sshutina
4fd4c96c2f 0032068: Inspectors - Last command don't have the time value 2021-01-19 19:17:54 +03:00
sshutina
cb3bf16180 0031959: Inspectors - Statistics by name 2021-01-14 09:41:08 +03:00
mpv
d511b727e3 0031921: Application Framework - reading OCAF data from several threads is not possible
Make myLastFoundChild field of TDF_LabelNode that can be changed during accessing to different sub-labels in different threads as atomic (only for newer versions of compilers which support this "atomic").

Added definition of Standard_ATOMIC macro to the Standard_Macro.hxx

(cherry picked from commit e80a307718)
2021-01-14 00:07:18 +03:00
age
724fe4d711 0031987: Visualization - Slow rectangular selection on models with big number of sensitives
(cherry picked from commit 726a195668)
2021-01-14 00:06:30 +03:00
age
d79a0af187 0030737: Visualization - implementing new selection schemes in context
Improved AIS_SelectionScheme_ReplaceExtra scheme (now is a part of AIS_SelectionScheme_Replace)
Replaced AIS_NListOfEntityOwner with AIS_NArray1OfEntityOwner
Fixed bug with incorrect highlighting in xor mode (select several times the same objects)
Fixed selections filters
Cherry picked a new highlighting logic from 75cf82505b
2020-12-22 14:52:46 +03:00
nds
b157d88ccb 0030737: Visualization - implementing new selection schemes in context
AIS_SelectionScheme_ReplaceExtra introduce
2020-12-22 13:45:15 +03:00
nds
318bf93ea9 0030737: Visualization - implementing new selection schemes in context
AIS_SelectionScheme enumeration is defined to set which selection behaviour is used in Select of context
AIS_InteractiveContext is corrected to use single Select method instead of combination of Select/ShiftSelect methods with a selection scheme parameter.
Upgrade: Select() -> SelectDetected/Rectangle/Polygon(AIS_SelectionScheme_Replace), ShiftSelect -> SelectDetected/Rectangle/Polygon(AIS_SelectionScheme_XOR)
2020-12-22 13:45:02 +03:00
age
8fa465a463 Revert "0030737: Visualization - implementing new selection schemes in context"
This reverts commit 502194e4fc.
2020-12-22 13:43:01 +03:00
nds
b34d24534d 0031350: Inspectors - property view in DFBrowser for DumpJson
(cherry picked from commit 19b5d8465313c119c9d2f344041e67883226ec61)
2020-11-19 10:03:40 +03:00
nds
dee527369c 0031945: Foundation Classes - unique names of alerts of message report in DumpJson 2020-11-19 10:03:27 +03:00
nds
1bd8dfa582 0031944: Foundation Classes - mutex for message level
(cherry picked from commit 0f07a04a85dedd375a5383f3cb0031c0a6d6b329)
2020-11-19 10:03:18 +03:00
nds
a463065302 0031362: Inspectors - MessageView plugin for message alerts
- OSD_Timer in message alert,
- DumpJson correction,
- Selection owner should be dumped in selector. Sensitive entities might be used in the same owner, that leads to lots of the same dump in the result stream.

(cherry picked from commit e8bde810616e61cbe925981176681f2840234fa4)
2020-11-19 10:02:34 +03:00
age
50013cf4a3 0031757: Visualization - Prebuild BVH for Select3D_SensitiveEntity in separate threads 2020-09-17 11:43:55 +03:00
age
808868370b 0031716: Visualization, Select3D_SensitiveSet::matches() - avoid building BVH in case of full overlapping by the volume 2020-09-17 11:43:55 +03:00
kgv
e91225a089 0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with Graphic3d_TOSM_UNLIT shading model
Prs3d_ShadingAspect::SetTransparency() now sets transparency also to interior color.
AIS_RubberBand now uses Graphic3d_TOSM_UNLIT.

(cherry picked from commit cc07d3180c48e31308d71c3f3b0108e1026fd4ca)
2020-07-23 00:45:47 +03:00
nds
9804a28dd2 0031678: Visualization - text color becomes lighter than in 7.3.0
(cherry picked from commit 1855383438db33933106aa5848ac00569731a407)
2020-07-21 18:24:20 +03:00
nds
b51929ad8f 0029451: Information Message Alert to debug an algorithm or object functionality 2020-06-21 12:42:42 +03:00
nds
b96cd2e422 0031579: Visualization - OpenGl_CappingAlgo performance on some clipping planes
(cherry picked from commit 61d75276ea924e0fd22de0a2a927bce1d554de99)
2020-06-03 11:09:52 +03:00
nds
0fcf0a687b 0029451: Information Message Alert to debug an algorithm or object functionality 2020-05-26 19:14:16 +03:00
snn
3613704c7a 0030988: Add possibility to attach multiple files to notes
- Swap child/father in RemoveFromGroup method of NotesTool.

(cherry picked from commit 7c0ec2e214)
2020-05-16 12:11:33 +03:00
nds
8ec5b8fd57 0029451: Information Message Alert to debug an algorithm or object functionality 2020-05-16 12:10:08 +03:00
nds
b4a5214bd2 0031326: Foundation Classes - Init from Json for base OCCT classes
(cherry picked from commit 39f197676cb85d2b84ad0ff15266eed118cbbaff)
(cherry picked from commit 4a5e30db5bbdfc7a77a03d1e55e8a3bee5d79d2d)
2020-05-15 21:52:15 +03:00
sshutina
9358c97d65 0031354: Visualization - Dump improvement for V3d, Graphic3d, Aspect
(cherry picked from commit 0a9f129d67748f59a40e7758d271e87ae4d535de)

# Conflicts:
#	src/Graphic3d/Graphic3d_CView.cxx
#	src/Graphic3d/Graphic3d_WorldViewProjState.hxx
#	src/SelectMgr/SelectMgr_TriangularFrustumSet.cxx
#	src/SelectMgr/SelectMgr_TriangularFrustumSet.hxx
2020-05-15 21:51:35 +03:00
nds
ada40fab8f 0030784: Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using
(cherry picked from commit 707e554dba56681d110b164cb4ea8b47723e7007)
2020-05-15 21:47:43 +03:00
nds
974ff986e1 0031221: Visualization - selection filter in context
(cherry picked from commit 0ef1e0394c44f7cb1753634f53e6ef0e8cda86ad)

# Conflicts:
#	src/AIS/AIS_InteractiveContext_1.cxx
(cherry picked from commit 53bbb3d99268d9aa89affe051ff82b51539a9946)
2020-05-15 21:47:30 +03:00
nds
35536f899d 0031197: Visualization - SetTransformPersistence for highlight, select presentations
(cherry picked from commit df3644aa35)
(cherry picked from commit 33ffefa2f7)
(cherry picked from commit 59433e7b4e49362dc1741dc00178ccec64c6cc5d)
2020-05-15 21:46:31 +03:00
nds
1a716308ea 0030791: Visualization - possibility to display materials by different hatching style for clipping
(cherry picked from commit ab39c2510fa4c9a568deb226cca37fe22c3162c4)

# Conflicts:
#	src/ViewerTest/ViewerTest_ViewerCommands.cxx
2020-05-15 21:46:09 +03:00
nds
8758ba290f 0030537: Visualization - wrapping text in font text formatter
Font_TextFormatter inherits Standard_Transient, now it is given as a handle in functions.
Graphic3d_Text - extended with Font_TextFormatter to be able to have it filled out of text render. If it is not defined here, the default text formatter of context is used.
OpenGl_Context - has default Font_TextFormatter for rendering OpenGl_Text.
2020-05-15 21:42:53 +03:00
nds
86ba800ae8 0030737: Visualization - implementing new selection schemes in context
(cherry picked from commit 8ac88685123f50caef2b53010da626b4682d9bd4)
2020-05-15 21:41:29 +03:00
snn
0a63642bc5 0030988: Add possibility to attach multiple files to notes
Implemented

(cherry picked from commit 9640291ff0)

# Conflicts:
#	src/XCAFDoc/XCAFDoc_AssemblyItemId.cxx
#	src/XCAFDoc/XCAFDoc_NoteBinData.cxx
#	src/XCAFDoc/XCAFDoc_NoteComment.cxx
#	src/XCAFDoc/XCAFDoc_NotesTool.cxx
#	src/XmlMXCAFDoc/XmlMXCAFDoc.cxx
(cherry picked from commit c5d24136ed56ae680dae4f544399a94998ee0962)
2020-05-15 21:37:14 +03:00
snn
57caa76519 0030392: XCAFDoc_GraphNode doesn't copy backward links
(cherry picked from commit 6131065fae)
(cherry picked from commit 713624228050b8f7db4d8b2e22c7edfd8c832471)
(cherry picked from commit b7fb7db6ae)
(cherry picked from commit 68be9e7b9c)
(cherry picked from commit 6bc54a6b6fc335b802959d612f0ed4edbb5d5c33)
2020-05-15 21:36:30 +03:00
nds
c7b1056827 refs 474:Possibility to create and play animations 2020-05-15 21:35:46 +03:00
nds
a7d082c424 refs #355: Add possibility to hide clipping plane
(cherry picked from commit ca1f82f6c6860a2e1995d7d9a66ce8c152e9d3cc)
(cherry picked from commit 61f39b4dc7)
(cherry picked from commit 7b08ab936a5f6091651fc0311c5c255bd0dc9cb0)

# Conflicts:
#	src/XCAFDoc/XCAFDoc.hxx
(cherry picked from commit 72e4a10556)
(cherry picked from commit 37d575793d)
(cherry picked from commit 6964d28a314f847255d1d1cb015dcbd68b3ec1aa)
2020-05-15 21:33:50 +03:00
nds
e6a3685503 XCAFDoc/View fixes to store in the view: image, parts transparency, notes, notes positions 2020-05-15 21:32:25 +03:00
vsv
4db6748cc5 0031544: Visualization - show boundaries of faces in shading mode of VTK presentation 2020-05-15 18:39:31 +03:00
kgv
158f2931a7 0031004: Coding - eliminate warnings issued by gcc 9.1.0
Fixed -Wrestrict warning within OSD::SetSignal().

Fixed -Wdeprecated-copy warning by adding missing counterpart
in pair copy constructor / assignment operator or by removing trivial constructor.

AdvApp2Var_Node, AdvApp2Var_Patch are now declared as Handle.
AdvApp2Var_Iso is now passed by Handle.

Disabled operator= for TDF_Transaction and TDF_IDFilter.

Standard.cxx - fixed GCC version mischeck causing building failure with experimental GCC versions.

TopOpeBRepDS_EXPORT.cxx - fixed -Wmaybe-uninitialized warnings.
2020-05-15 18:08:07 +03:00
emv
4b59685af1 0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode "Complete" join type "Intersection"
Mark unchecked edges originated from vertices as invalid if they are contained in invalid faces.
2020-05-15 18:05:59 +03:00
emv
9e9b826aa1 0031307: Modeling Algorithms - Offset algorithm produces incorrect result in mode "Complete" join type "Intersection"
Do not classify edges originated from combination of edges and vertices as the classification will likely be unstable.
Mark faces containing valid inverted edges as invalid but do not remove them from valid splits.

Extend the debug command DBRep_SetComp to allow different containers for creating the TopoDS_Compound.
2020-05-15 18:05:58 +03:00
ifv
64e8b010af 0031552: Bad performance of intersection of cylindrical surfaces
Adjusting parameters of algorithm depending on axes and parameters of cylinders is added in order to reduce computation time

Test case added: tests/lowalgos/intss/bug31552

tests/perf/modalg/bug26310_1: test case corrected according to current state of algorithm
2020-05-15 18:00:48 +03:00
jfa
1b6e8b9f09 0031565: Visualization - SIGFPE, Arithmetic exception if SelectMgr_TriangularFrustumSet::Build() is called with single point 2020-05-15 18:00:47 +03:00
dpasukhi
b04decfaae 0029240: Data Exchange - Crash during reading STEP file
- Issue is done in previous version OCCT
- Add test to verify import
2020-05-14 20:28:22 +03:00
ifv
79aa9b5cf6 0027087: [Regression to OCCT 6.7.1] BRepExtrema_DistShapeShape gives wrong result
Extrema_ExtCs.cxx: number of subdivision is incresed for curve;

Modifications to fix regressions of some tests
IntTools_BeanFaceIntersector.cxx: restriction of curve, which is used in Extrema_ExtCS
ProjLib_CompProjectedCurve.cxx: tolerance is reduced for Extrema_ExtCS
BRepOffset_Tool.cxx: checking common vertex if it is Null

tests/bugs/modalg_7/bug27087 : test case added.

tests/bugs/modalg_5/bug25232_8 : test is modified according to new behavior of algorithms
2020-05-14 20:24:45 +03:00
dpasukhi
72e6020d50 0026925: Data Exchange - Exception can be raised if assembly is empty
- Issue is done in previous version OCCT
- Add test to verify the creating of the label structure using plain OCAF/XDE API
- Situation when the assembly label has no shape attached is correct
2020-05-12 19:51:12 +03:00
kgv
a87b1b3738 0031501: Foundation Classes, Message_Printer - remove theToPutEndl argument -- use shortcuts
Message::DefaultMessenger()->Send() have been replaced by shortcuts Message::Send().
2020-05-09 17:22:15 +03:00
kgv
fa8a462827 0031501: Foundation Classes, Message_Printer - remove theToPutEndl argument
The argument putEndl has been removed from Message_Messenger::Send() and Message_Printer::Send() methods.

Message_Printer interface has been changed, so that sub-classes have to implement new method
Message_Printer::send() accepting TCollection_AsciiString.
Old three Message_Printer::Send() methods remain available without putEndl argument
and redirecting to new send() method by default.

Removed dummy Message_PrinterOStream::GetUseUtf8() property.
Message_PrinterOStream, Message_PrinterSystemLog and Draw_Printer
now implement single method Message_Printer::send() instead of triplet.
2020-05-09 17:22:14 +03:00
abv
0ebe5b0a7f 0031501: Foundation Classes, Message_Printer - remove theToPutEndl argument -- preparation
Operators << for Handle(Message_Messenger) are removed; their use is replaced by use of Message_Messenger::StreamBuffer
Message_Messenger has been replaced by Standard_OStream within Interface_InterfaceModel,IFSelect,IGES,STEP dump interfaces.
2020-05-09 17:22:13 +03:00
abv
39c8dc708f 0031546: Application Framework - Memory leak (100 bytes) on Load / Close OCAF document
Class Standard_BaseDriver is inherited from Standard_Transient, its descendants are updated accordingly.
Handle is used to manipulate objects of this class and its descendants (instead of references or raw pointers) to ensure automatic destruction.

Added test bugs caf bug31546

Related:
- Standard_OVERRIDE is added in declarations of virtual methods in descendants of Storage_BaseDriver
- Methods operator << and operator >> are removed in descendants of Storage_BaseDriver (they repeat the same methods inherited from the base class)
- Typedef PCDM_BaseDriverPointer is marked as deprecated
- Unused class DDI_Ostream is removed
- Private field Standard_Transient::count is renamed to myRefCount_ to avoid compiler warnings if the same name is used within the scope of a descendant class
- Output of meaningful error messages is restored in DRAW commands fsdread and fsdwrite
2020-05-07 21:24:46 +03:00
ifv
dcc4e908c2 0030185: Unify same domain algorithm corrupts the initial shape
ShapeUpgrade_UnifySameDomain.cxx: checking of surface domains and projection to get pcurves are added
tests/bugs/heal/bug30185: test case added
2020-05-07 21:23:16 +03:00
kgv
b40cdc2b55 0029384: Visualization, TKOpenGl - basic integration with OpenVR
V3d_View::AutoZFit() is now called only before redraw
within methods V3d_View::Redraw() and V3d_View::Update().

Graphic3d_CView now holds Aspect_ExtendedRealitySession object.
Aspect_OpenVRSession implements new interface via optional OpenVR library.
Graphic3d_CView::ProcessInput() - added new interface method
which should be called for processing positional input (head tracking).

Graphic3d_Camera now allows setting custom stereoscopic Projection matrices.

OpenGl_Context::Camera() - context now holds Camera object
in addition to active camera matrices.

genproj.tcl has been extended to handle optional CSF_OpenVR dependency.
2020-05-06 20:45:53 +03:00
kgv
2615c2d705 0031548: Visualization, SelectBasics_PickResult - include surface normal into picking details
SelectMgr_SortCriterion::Normal, SelectBasics_PickResult::SurfaceNormal() - added new property.
SelectMgr_RectangularFrustum::Overlaps() for triangle sets new normal property.
gp_GTrsf::GetMat4() - added conversion into NCollection_Mat4 similar to gp_Trsf::GetMat4().
2020-05-06 19:09:53 +03:00
kgv
23fe70ec52 0031189: Draw Harness, ViewerTest - send messages to Message::DefaultMessenger()
Added short-cuts methods in Message_Messenger for sending message with specified gravity,
and stream buffer class for using stream-like interface for that.
Similar short-cuts to DefaultMessenger() are added in Message package.

ViewerTest has been updated to send messages to Message::DefaultMessenger()
instead of direct output to std::cout/std::cerr.

Off-topic: spelling error (duplicate "and") is corrected in two places

Added test bugs fclasses bug31189
2020-04-30 19:42:44 +03:00
ika
331bcfc0d0 0031517: Data Exchange - wrong result of ShapeTool::UpdateAssemblies()
Get rid of problem with updating of parents shared one assembly.
2020-04-29 20:45:52 +03:00
kgv
7ff18fb9cc 0031521: Samples - update MFC ImportExport sample to use AIS_ViewController
The following MFC samples have been updated to use AIS_ViewController:
Geometry, HLR, ImportExport, Modeling, OCAF, Triangulation, Viewer2D.
2020-04-29 20:44:15 +03:00
nds
ab9e277f15 0031193: Visualization - OpenGl_Flipping wrong text position if local transformation set
Before the patch, if the values of the isReversedX/Y/Z variables were set to false, then the WorldView matrix did not change and local transformation was not applied, which caused errors.
In order to correctly set the local transformation in case the text does not have its own attach point, the local transformation is set in OpenGl_Text, and the ModelWorld matrix is changed in OpenGl_Flipper, instead of the WorldView matrix. In this case, local transformation will always be applied.

bugs/vis/bug31193: test case added
2020-04-29 16:36:23 +03:00
kgv
0439d1cf44 0031518: Samples - update QtWidget samples to use AIS_ViewController
Qt samples IESample and Tutorial have been updated to use AIS_ViewController for view manipulations.
2020-04-26 11:33:26 +03:00
kgv
e1c9a10311 0031519: Visualization, AIS_ViewController - add AIS_MouseGesture_ZoomWindow gesture
AIS_ViewController now supports AIS_MouseGesture_ZoomWindow gesture,
which displays zooming window via Rubber-Band rectangle.
2020-04-24 20:03:50 +03:00
kgv
9ad4ff93a0 0031511: Point Cloud Rendering, Volume Rendering - reuse Graphic3d_CullingTool
Graphic3d_CullingTool::IsCulled() has been extended with theIsInside argument for full inclusion test.
Graphic3d_Layer::UpdateCulling() now avoids frustum culling tests for BVH children for parent nodes completely included into frustum.
Graphic3d_CullingTool::SetViewVolume() has been extended by optional model-world matrix.
2020-04-24 20:03:50 +03:00
kgv
89fcfe1551 0031512: Foundation Classes - drop unused class NCollection_Comparator 2020-04-23 10:45:50 +03:00
mzernova
a24a782174 0031440: Visualization - Impossible to make common behaviour for multi-selection in viewer
A special mode for the selecting by polygon is added to select only completely overlapping objects.

In order to track the sensitives that were included completely by defined polygon, the boundary points of the polygonal frustrum are stored in the variable myBoundaryPoints.

If an sensitive intersects with at least one of the frustrums from myFrustums, then checking whether this object intersects with borders using the isIntersectBoundary method; if not, then the sensitive were included completely by defined polygon.

Because the polygon can be concave, then to check the sensitive were included completely by defined polygon, it is not enough to check of all its points, it is necessary that the edges of the sensitive do not intersect polygonal frustrum. To do this, for polygonal selection, a call to the Overlaps method for a point was replaced by a call to a segment where necessary.

bugs/vis/bug31440: test case added
2020-04-23 10:44:30 +03:00
jgv
5a2f31c887 0031492: BRepBuilderAPI_MakeFace crashes on a wire
Method BRepClass_Intersector::LocalGeometry is modified: check whether is tangent defined and check of infinite curvature is added.
2020-04-20 20:36:27 +03:00
akaftasev
67a843c0d4 0031318: Documentation, TopoDS.hxx - typo in the reference manual
change "onject" to "object" in description of TopoDS class
2020-04-17 18:45:50 +03:00
kgv
b9f43ad13b 0031505: Point Cloud Rendering - fix on-screen statistics about number of visible points
OpenGl_Element now provide methods ::UpdateMemStats() and ::UpdateDrawStats()
for unified request of statistics used by OpenGl_FrameStats instead of direct handling of OpenGl_PrimitiveArray.
Graphic3d_FrameStatsCounter counters list has been extended by Graphic3d_FrameStatsCounter_NbLinesNotCulled.
2020-04-17 18:36:43 +03:00
kgv
b8a00b410a 0031502: Coding - New warnings after integration fix for 0031456
Deprecated AIS class aliases have been moved from PrsDim to AIS package.
2020-04-17 17:43:00 +03:00
dpasukhi
e00b8ed948 0031435: Data Exchange - Problem importing STEP files
- Fix recursion in EntityCluster's methods :
  -  Value
  -  SetValue
  -  Append
- Add destructor in the EntityCluster
- Add check null grade in the STEPCAFControl_GDTProperty::GetDimClassOfTolerance
2020-04-16 20:43:51 +03:00
emv
590b3f0416 0031499: Boolean Operations - Custom fuzzy value corrupts the result of CUT
IntPatch_ImpImpIntersection::CyCyNoGeometric - Use the provided 3D tolerance to compare the points.
2020-04-16 10:01:55 +03:00
emv
62fbfa9856 0031207: Regression in Boolean Operations: fuse gives wrong result
ForceInterfEE, ForceInterfEF - Use normalized vectors for angle computation. Increase the criteria angle.
2020-04-16 10:00:54 +03:00
ifv
1f9cb9f999 0031496: Modeling Algorithms - BRepAlgo::ConcatenateWireC0() crashes
BRepAlgo.cxx: fixing of wrong treatment of reversed edges
bug31496: test case added
2020-04-16 09:59:25 +03:00
jgv
13dd311c9b 0031470: Modeling Algorithms - Regression: BOP common produces empty result (box and holed sphere)
Approx_ComputeCLine.gxx : new class field is added to manage hang checking.
ProjLib/ProjLib_ComputeApprox.cxx : unset hang checking for analytical surfaces and curves
2020-04-16 09:58:15 +03:00
gka
1e1b83c07b 0031472: Exception raised during translation of the STEP entity Constructive Geometry Representation containing one representation
Modification number of the representation items are considered for STEP entity "Constructive Geometry Representation"
2020-04-10 17:43:52 +03:00
kgv
8f08e231fa 0031490: Foundation Classes, Poly_Connect - speed up temporary allocations
Poly_Connect::Load() now uses NCollection_IncAllocator instead of new/delete
for allocation temporary sequence elements.

StdPrs_ShadedShape, fillFaceBoundaries() now uses NCollection_IncAllocator for temporary points.
2020-04-10 17:41:40 +03:00
ifv
f0ada3e8d4 0031469: BRepFeat_MakePrism failed
BRepFeat_Form.cxx: methods IsDeleted, Modified, Generated are corrected
BRepTest_FeatureCommands.cxx: history treatment is added in methods DEFIN and PERF
bugs/modalg_7/bug31469: test case added
2020-04-10 17:41:39 +03:00
jgv
9171cefaad 0031464: BRepOffsetAPI_MakeFilling algorithm increases tolerances of vertices in input edges
Modify history in BRepFill_Filling: now vertices are also stored in the map.
2020-04-10 17:41:39 +03:00
kgv
247ecf1b16 0031483: Configuration - __asm keyword not supported on ARM within Windows target
_M_IX86 is now checked before using _asm fot TBB workaround.
2020-04-10 17:41:38 +03:00
emv
3f7e5e99d5 0031462: Modeling Algorithms - BOP result depends on the arguments order
Eliminate numerical instability by ensuring that the tolerance of intersection entities is slightly grater than the actual distance to the shapes creating the entity.
2020-04-01 20:44:23 +03:00
kgv
6d43db4f74 0031471: Confuguration, genproj - unable to build OCC Products
Restored parsing of src/VAS/Products.tcl.
2020-04-01 13:42:12 +03:00
emv
128654b60b 0031461: Mesh - Add possibility to force the meshing of the shape
BRepMesh: Add new mesh parameter *AllowQualityDecrease* which affects the criteria used for checking of the consistency of the existing mesh to new meshing parameters.
So if set to true it will force the meshing of the shape if current deflection strongly vary from the new one, no matter in which side.

BRepTools::Clean: Keep triangulation on non-geometric shapes (faces with no surface or edges with no curves).
2020-04-01 13:36:29 +03:00
osa
21095f2dc2 0031468: Visualization - add public interface to return embedding a single fallback font 2020-04-01 13:34:08 +03:00
kgv
420f5c8682 0031467: Foundation Classes, OSD_MemInfo - disable reading /proc/%d/status with Emscripten
OSD_MemInfo::Update() no more uses procfs with Emscripten.
OSD_MemInfo::MemVirtual counter is now set to WebAssembly module heap length.
2020-03-27 18:03:20 +03:00
kgv
85b147584e 0031465: Data Exchange, RWObj_Reader - skip duplicating smooth groups
RWObj_Reader::pushSmoothGroup() now ignores smooth groups statements pointing to the same group.
2020-03-27 18:01:01 +03:00
kgv
7f24b768c3 0031458: Visualization - refine classes across Prs3d and StdPrs packages
Prs3d::GetDeflection() has been moved to StdPrs_ToolTriangulatedShape::GetDeflection().
Prs3d_ShapeTool has been moved to StdPrs_ShapeTool.
Code collecting free edges on Poly_Triangulation
has been moved out from StdPrs_WFShape to Prs3d::AddFreeEdges().
StdPrs_BndBox has been moved to Prs3d_BndBox.
Geom_Transformation has been replaced by TopLoc_Datum3D within visualization classes.

Select3D_SensitiveCircle constructor now takes gp_Circ instead of Geom_Circle.
StdSelect_ViewerSelector3d has been moved to SelectMgr_ViewerSelector3d.
Methods ::GetPoint3d() and ::ArrayBounds() has been moved
from subclass Select3D_SensitiveCircle to the base class Select3D_SensitiveCurve.
StdSelect_ViewerSelector3d::computeSensitivePrs() has been moved to SelectMgr::ComputeSensitivePrs().

Removed unused declarations StdSelect_Prs, StdSelect_DisplayMode,
StdSelect_SensitivityMode, StdSelect_TypeOfResult, SelectMgr_SOPtr, TColQuantity.

Package Graphic3d has been moved from TKV3d to TKService.
2020-03-27 17:58:02 +03:00
kgv
787ff2408c 0031456: Visualization - move out Dimensions and Relations from package AIS to PrsDims
The following classes and their subclasses within AIS package
have been moved to new package PrsDim and renamed:
- AIS_Relation  -> PrsDim_Relation;
- AIS_Dimension -> PrsDim_Dimension,
2020-03-27 17:58:00 +03:00
mzernova
64943a5187 0031459: Visualization, AIS_TextLabel - add missing getters
Add getters for Text, FontName and FontAspect
Remove duplicate properties: Font and FontAspect
2020-03-26 19:59:16 +03:00
jgv
486ad71287 0031441: UnifySameDomain corrupts the shape
Local function TransformPCurves is modified to process correctly same-domain elementary surfaces with different local coordinate systems.
2020-03-26 19:57:52 +03:00
oan
c9125b6232 0031378: Modeling algorithms - brep incremental mesh is frozen during STEP file loading
Refactoring of BRepMesh_Delaun::isBoundToFrontier() to unwind the recursion loop.
2020-03-26 19:56:21 +03:00
ifv
87c7d55469 0031415: Modeling Algorithms - Solid classifier works incorrectly on a cylinder
BRepClass3d_SClassifier.cxx : revert integration for CR29712

Test case added
2020-03-26 19:54:58 +03:00
abv
14b741b0ef 0031454: Visualization - perceptually uniform color scale
Support of CIE Lab and Lch color spaces is introduced in Quantity_Color:
- Enumeration Quantity_TypeOfColor is extended by new values representing CIE Lab and Lch color spaces (with D65 2 deg illuminant).
- Conversion of RGB color to and from these color spaces is implemented in Quantity_Color class (within existing API).
- Color difference calculation using CIE Delta E 200 formula is implemented in method DeltaE2000().

New methods MakeUniformColors() and SetUniformColors() are added in class AIS_ColorScale, generating and setting color scale based on colors of the same lightness in CIE Lch color model.

DRAW commands vcolorconvert and vcolordiff are added to perform conversions and compute difference, respectively.
A new option -uniform is added in DRAW command vcolorscale, to set uniform color scale.

Added test grid v3d colors (color conversions and difference), test bugs vis bug31454 (uniform color scale)
2020-03-26 19:53:27 +03:00
gka
89180f9822 0029803: STEP Import: Units (inch) not applied to entity possessing GEOMETRIC_REPRESENTATION_CONTEXT
Translation of the entities AXIS2_PLACEMENT_3D including in the entity CONSTRUCTIVE_GEOMETRY_REPRESENTATION_RELATIONSHIP was added.
Entity  AXIS2_PLACEMENT_3D is translated to the planar face with axis equal to AXIS2_PLACEMENT_3D.
New parameter "read.step.constructivegeom.relationship" is added to enable this translation (by default it is OFF).

Added test bugs step bug29803
2020-03-25 19:52:12 +03:00
ifv
517ba7aa70 0031460: Modeling Algorithms - Regression: Revolution not done.
BRepPrimAPI_MakeRevol.cxx: check of intersection of edge with rotation axis is improved.
Test case added
2020-03-24 19:57:37 +03:00
antonavt
68064d7bc3 0028880: Modeling Algorithms - add missing BRepFeat_SplitShape::Right() getter
- Added Right() method to BRepFeat_SplitShape;
- Added an option in command buc60854, which allows to select Left() or Right() method;
- Modified method BUC60854 in QABugs_14.cxx;
- Added new option to the help of command buc60854;
- Modified test case buc60854. Now its state is "OK";
- Added check Right() in buc60854 test case.
2020-03-24 19:55:05 +03:00
abv
62afcbbb4a 0031455: Modeling Algorithms - useless pointer casts in BRepAlgoAPI classes
Useless casts are removed.

Off-topic: corrected description of constructor of TCollection_HAsciiString class from TCollection_HExtendedString for the case when input string contains non-Ascii character.
2020-03-23 09:51:39 +03:00
gka
7ef1f9b7c1 0031301: Data Exchange - Export to STEP corrupts the shape
For small edges fully covered by tolerances of vertices BSpline periodic curves are converted to not periodic BSpline curves by cutting segment before writing.
In the class TopoDSToStep_MakeStepEdge permute of edge vertices for closed curves was added for the case when the range obtained from the vertex projection contradicts the edge range in order to avoid computation of the invalid edge range after reading.

Second test script for bug 0031301
2020-03-20 10:24:10 +03:00
kgv
877fd611ac 0031442: Samples - remove unsupported sample mfc/occtdemo 2020-03-20 10:22:25 +03:00
kgv
dc9f1dbf69 0031445: Advanced wrappers, C# wrapper - provide device info in About dialog of WPF sample
D3DHost_View::DiagnosticInformation() now appends D3D device information to the map.
2020-03-19 19:08:10 +03:00
ifv
895a80d38a 0031404: Modeling Algorithms - BOP Fuse produces a self-interfering or a good shape depending on the order of arguments
Approx_ComputeCLine.gxx : number of possible cuttings is increased

tests/bugs/modalg_7/bug31404 : test case added
2020-03-19 19:00:58 +03:00
gka
6a9f983a16 0030052: Data Exchange - STEP import missing surfaces
Changes made for #31233 are reverted.

Correction in the ShapeFix_ComposeShell:
 Modification of the method SplitByLine in order to find all points of the intersection for case when initial curve shifts in the positive or negative direction
 to avoid splitting edge when split point lies in the limits of the tolerance of the vertex.
 to correct shift of the pcurves for case when initial shift is more than 1 in the method ShapeFix_ComposeShell::SplitByLine

In the method ShapeFix_Face::FixMissingSeam added removing small edges having length less than working precision and removing wires having area less than working precision

Modified test cases; added test for related issue: bugs step bug31301
2020-03-18 20:03:05 +03:00
mgn
22fa1da36e 0031439: Visualization - Access to the active axis of AIS Manipulator
A new method that returns the active axis of the manipulator has been added.
2020-03-18 19:39:38 +03:00
Roman Lygin
fb99177766 0031430: Offset surfaces on C1 surfaces (with multiplicity equal to degree) may still throw exception
In constructor of Geom_RectangularTrimmedSurface, skip check if an offset surface has insufficient continuity. The reason is that this surface has already passed the check once created. So, here we must not apply more strict check than that first time.
2020-03-18 19:38:12 +03:00
kgv
67441d0ca3 0031424: Visualization - stop using Prs3d_Drawer::HLRAngle() parameter
Prs3d_Drawer, AIS_Shape, AIS_InteractiveContext - removed properties HLRDeviationCoefficient() and HLRAngle().
Prs3d_Drawer::HLRAngle() is kept as alias to Prs3d_Drawer::DeviationAngle() with deprecated flag.
Prs3d_Drawer::DeviationAngle() default value is changed from 12 to 20 degrees
to match Prs3d_Drawer::HLRAngle() which has been previously used in majority of cases.
Removed unused property HLRBRep_PolyAlgo::Angle().
2020-03-16 16:56:30 +03:00
kgv
b5163d2f8d 0031431: Visualization, PrsMgr_PresentableObject - simplify HLR computing interface
Multiple PrsMgr_PresentableObject::Compute() methods have been replaced by single one
PrsMgr_PresentableObject::computeHLR().
Dummy implementations of previously declared methods have been removed
from AIS classes not implementng HLR presentation.
Class Prs3d_Projector has been removed and Graphic3d_Camera is now passed directly,
so that redundant dependency from HLRAlgo_Projector in Prs3d interfaces has been eliminated.
StdPrs_HLRShape and StdPrs_HLRPolyShape now implement common interface StdPrs_HLRShapeI.
2020-03-16 16:56:28 +03:00
kgv
29263c947e 0031425: Visualization - free Edge has selection sensitivity inconsistent to presentation
BRepTools::Triangulation() has been extended with a new parameter for checking Poly_Polygon3D presense within free Edges.
StdPrs_WFShape::Add() now performs auto-triangulation in the same way as StdPrs_ShadedShape::Add().
StdSelect_BRepSelectionTool::GetEdgeSensitive() now creates Select3D_SensitiveSegment instead of Select3D_SensitiveCurve for tessellated segment.
Select3D_SensitiveSegment default sensitivity factor has been changed to 3 pixels to match Select3D_SensitiveCurve.

Test case bug23625_1, added workaround for out-of-range crash in HLRBRep_PolyAlgo on re-triangulated shape.
2020-03-12 19:29:23 +03:00
kgv
08669adf1b 0031419: Visualization, TKOpenGl - per-object Graphic3d_TOSM_FACET is ignored within obsolete FFP
OpenGl_ShaderManager::PushState() now sets GL_SHADE_MODEL within FFP.
OpenGl_Context::SetShadeModel(), added property holding cached GL_SHADE_MODEL state.
2020-03-11 18:37:12 +03:00
ifv
68ad329c9d 0031303: Different calculation of offset direction in Adaptor2d_OffsetCurve and Geom2d_OffsetCurve
Calculations in Adaptor2d_OffsetCurve are unified with similar calculations in Geom2d_OffsetCurve using   methods extracted from Geom2dEvaluator_OffsetCurve to Geom2dEvaluator.cxx

BRepFill_OffsetWire.cxx, Geom2dGcc_Circ2d2TanRadGeo.cxx, Geom2dGcc_Circ2dTanOnRadGeo.cxx, MAT2d_Circuit.cxx are modified to satisfy changing offset direction.
2020-03-11 16:37:50 +03:00
azv
d6e18114eb 0031407: [Regression to 7.3.0] Extrema does not process parallel circles correctly
Use correct ranges of circles when processing the concentric case. Repeat the range comparison 3 times shifting each time for a half-period to process the extrema between boundary points of arcs.
2020-03-06 16:05:19 +03:00
kgv
e5c11edd7b 0031405: Advanced wrappers, C# wrapper - dark colors in WPF sample
D3DHost_FrameBuffer::IsSRGBReady() - added new propery defining if
D3D application handles FBO as sRGB-ready texture or not.
2020-03-06 16:03:33 +03:00
ifv
fffc249f21 0027531: Modeling Algorithms - Make the algorithm Approx_SameParameter more clear and robust
Approx/Approx_SameParameter.cxx,hxx:
Class Approx_SameParameter refactoring. Logic is changed in many places to unify usage, simplify maintenance.
Method Curve2d() is changed to return Geom2d_Curve instead of Geom2d_BSplineCurve. Corresponding message is added to the upgrade guide.
.lxx file is merged into .hxx.
Tangent computation is extracted into special method.
Comparing number of sample points after CheckSameParameter(...) is added to define cases with projection fails.
Undesirable behavior when curves are not same parameterized is fixed.

Geom2dAdaptor/Geom2dAdaptor.cxx: treatment of offset curve is added

Adaptor3d/Adaptor3d_TopolTool.cxx: minor improvement of performance for BSpline surfaces with huge number of knots

Tests were modified according to new behavior of sameparameter algorithm
2020-03-06 15:54:46 +03:00
emv
739c7e5968 0030386: Modeling Algorithms - Unable to perform Cut operation
Get rid of requirement for the arguments of Boolean operations of type CUT and COMMON to be one-dimensional shape. For FUSE operation this requirement is kept.
2020-03-04 19:17:16 +03:00
ifv
f732ea1ab5 0031381: Foundation Classes -wrong evaluations for rational BSpline curves using Adaptor curves
BSplCLib_Cache.cxx - it is forbidden zeroing derivatives for rational splines when derivative order more than degree

bug31381 - test case added
2020-03-03 17:49:09 +03:00
vro
ae87bb87d0 0031400: Application Framework, TPrsStd_AISPresentation - Ocaf selection mechanism doesn't allow multiple selection
TPrsStd_AISPresentation::ActivateSelectionMode() uses Multiple enumeration for definition of the selection mode instead of GlobalOrLocal.
2020-02-28 21:02:40 +03:00
kgv
3d60d73f76 0031394: Visualization, TKOpenGl - define OpenGl_Element::EstimatedDataSize() interface
OpenGl_FrameStats::updateStructures() now relies on OpenGl_Element inteface
instead of handling OpenGl_PrimitiveArray specifically
for collecting Graphic3d_FrameStatsCounter_EstimatedBytesGeom counter.
OpenGl_PrimitiveArray and OpenGl_Text implement new interface.
2020-02-28 21:02:40 +03:00
nds
0950253ca6 0031366: Documentation - Doxygen warnings in Standard_Dump.hxx 2020-02-22 13:01:25 +03:00
nds
f6d8ca74d5 0030749: Inspectors - compilation under tcl scripts
- 'Search Qt4' is renamed into 'Search Qt'. Configuration uses Qt5 from now. For Qt4 use CMake configuration.
- 'Build Inspector' check box is added. It causes 'tools' toolkits compilation. Activates automatically 'Search Qt' control.
- Many Tcl procedures are extended with additional parameter to giving a directory of processed toolkits. The default directory is 'src', inspector directory is 'tools'. This way is similar Inspector compilation implemented in Cmake build procedure.
- Dependency libraries in DEBUG are stored in __TKDEP_DEBUG__. Qt requires it as names of debug and release libraries are different.
2020-02-20 18:33:01 +03:00
vro
00cdefc7a2 0030101: Application Framework - A mistake reading a RealArray attribute with too small value
A case of reading of a very small value was skipped, for example: 2.1219957909652723e-314.
Fixed in XmlMDataStd_RealArrayDriver.cxx and XmlMDataStd_RealListDriver.cxx

// A test file bug29452.xml is extended to check this skipped case.
2020-02-19 19:34:10 +03:00
kgv
d850414af1 0031315: Visualization - marker texture is lost after multi-textured object
OpenGl_Context::BindTextures() now iterates over pair of texture sets
considering inconsistent texture unit ranges.
2020-02-19 19:31:58 +03:00
kgv
b380b06c5d 0031206: Foundation Classes, Message_PrinterSystemLog - log messages to Browser console within Emscripten
Message_PrinterOStream::SetConsoleTextColor() skips color tags in case of Emscripten.
Message_PrinterSystemLog now implements log via emscripten_log().
2020-02-17 14:35:46 +03:00
kgv
c64efd9e30 0031375: Visualization, TKOpenGl - suppress warning on WebGL 1.0
Check for WebGL version in advance.
2020-02-17 14:35:44 +03:00
kgv
cd43c08f2b 0031372: Visualization, TKOpenGl - failed to create texture on OpenGL ES 2.0 due to unknown GL_TEXTURE_BASE_LEVEL
OpenGl_Sampler::applySamplerParams() has been corrected to check for OpenGL ES 3.0
when applying GL_TEXTURE_BASE_LEVEL/GL_TEXTURE_MAX_LEVEL parameters.
2020-02-16 15:05:41 +03:00
nds
28b13b31aa 0031014: Inspectors - variables for Qt in CMake
It restores path to Qt binaries in 3RDPARTY_DLL_DIRS for correct start TInspectorEXE under VStudio.
2020-02-13 20:48:05 +03:00
sshutina
10ac040338 0031336: Modeling data - extend BRepPrimAPI_MakeBox with planar shape creation
-Create a new package BRepPreviewAPI, inherited from BRepPrimAPI to create both, valid and degenerative shapes
-Create a new class BRepPreviewAPI_MakeBox for working with a box
    Preview can be vertex, edge, rectangle or box
-BRepPrim_GWedge: in the case of non-valid data, the exception does not happen in the constructor, but at the moment of access to the shape
-BRepPrimAPI_MakeBox: myWedge is now not private, but protected, because used in  BRepPreviewAPI_MakeBox which inherits from BRepPrimAPI_MakeBox
-Add tests for checking of a creation a preview in tests/geometry/preview (vertex, edge, rectangle, box)
-Update a command "box": add new parameters
2020-02-12 18:00:37 +03:00
nds
7e1c1e4869 0030268: Inspectors - improvements in VInspector plugin
- Convert package creation. It is used to prepare some auxiliary presentations/methods to prepare variables for inspector based on occt classes.
- ViewControl package improvement:
  Classes for property view, table, table model are implemented to visualize view of properties.
  This view is filled by selection in tree if the selected object has implemented DumpJson functionality.
- TreeModel package improvements:
  Method InitColumn is implemented in TreeModel_TreeModel to fill default columns in base model. The default columns are:
    Name, Visibility, Rows. Additional columns should be added in successors.
  Container of root items is moved into the base class
- View package imrovements:
  Store preferences: display mode, fit all checked state and type of external context
  View_DisplayPreview is added to process preview for selected in tree view objects
  hide actions Clear, Multi, Single by default (as selection in tree view or Visibility state of item define which presentations should be displayed or erased)
- ShapeView plugin improvements:
  Property View content based on DumpJson (columns in tree view for properties are removed),
  Properties for TopoDS_Shape are displayed
  Explode shape action in tree view to see content of shape by selected shape type. Type of displayed shapes is only preview, it is not used in export action.
  Export shape into BREP. The previous implementation about BREP files in some directory and default view is removed.
- VInspector plugin imrovements:
  Property View content based on DumpJson (columns in tree view for properties are removed),
  Properties for AIS_InteractiveContext and AIS_InteractiveObject are displayed
  obsolete classes to provide properties are removed.
- DFBrowser plugin improvements:
  Property View content based on DumpJson is not used yet. But there is the USE_DUMPJSON macro. It's switch off by default.
  If switch ON, it creates a Property View filled with DumpJson. It's a way of DFBrowser moving on this property view.
  Init uses static variable CDF_Session::CurrentSession()->CurrentApplication to fill plugin if application in plugin is not set but OCAF application exists

- OCC_VERSION_HEX variable used for previous OCCT versions support (before 6.9.0 or 7.2.0) is removed
2020-02-12 18:00:36 +03:00
kgv
a2803f37e7 0031341: Visualization - Graphic3d_Layer::UpdateCulling() ignores Presentation range
Graphic3d_Layer::UpdateCulling() now takes into account BVH_Tree::EndPrimitive().
'vstatprofiler structs' now properly prints number of structures in case of no culling.
2020-02-11 18:42:13 +03:00
abv
18348b382e 0031364: Foundation Classes - unused enumerations in GeomAbs package
Files GeomAbs_CurveForm.hxx, GeomAbs_SurfaceForm.hxx, GeomAbs_UVSense.hxx are removed
2020-02-11 18:42:12 +03:00
abv
64e68ea690 0031363: Documentation - broken Doxygen documentation of header files in Standard package
Documentation is corrected
2020-02-11 18:42:12 +03:00
anv
bee13ef1cf 0031360: Modeling Algorithms - Removing redundant class
math_GaussPoints was removed.
2020-02-07 18:23:45 +03:00
kgv
e73ef9d219 0031356: Visualization - out of range within StdPrs_WFShape::AddEdgesOnTriangulation()
Removed unused code causing the issue.
2020-02-07 14:22:01 +03:00
anv
8b3fbdef34 0031233: Reading SAT files produces invalid shapes
Added removal of overlapping "tails" while splitting wires with a seam edge in ShapeFix_ComposeShell::SplitWire.
2020-02-06 18:01:21 +03:00
kgv
e2550e48f1 0031333: Data Exchange - RWGltf_TriangulationReader::readBuffer() fails to read interleaved buffer at the end of file
Standard_ReadBuffer has been extended with a flag for reading an interleaved data.
RWGltf_TriangulationReader::readBuffer() uses new flag for reading vertex attributes.
2020-02-06 17:45:05 +03:00
oan
62beabff7c 0025551: BRepMesh can produce internal nodes outside the face interior based on distorted BSpline surface
updated test script to see the difference on current version of OCCT
2020-02-06 17:41:07 +03:00
oan
5e06dfcb32 0028247: Effect of minSize parameter of BRepMesh_IncrementalMesh seems to be too strong Updated description of MinSize parameter of IMeshTools_Parameters 2020-02-06 17:41:06 +03:00
oan
35befde2ad 0026382: BRepMesh produces internal nodes outside the face interior
updated test script: clean up shape before meshing to see the difference
2020-02-06 17:41:06 +03:00
nds
bc73b00672 0031313: Foundation Classes - Dump improvement for classes
- Provide DumpJson for geometrical, ocaf and visualization classes;
- Change depth parameter of DumpJson (constant is not obligate here)
- Introduce a new macro for transient objects to be called as the first row in DumpJson: OCCT_DUMP_TRANSIENT_CLASS_BEGIN. We need not put the class name in the macro, using get_type_name of Standard_Transient for it.
- change implementation of OCCT_DUMP_CLASS_BEGIN and OCCT_DUMP_TRANSIENT_CLASS_BEGIN. It is not an sentry more and it does not create a new hierarchy level. It appends a new row into the output stream: "className": <className>
- OCCT_DUMP_* does not require semicolon
- class header is included first in source files of TDataStd, TDocStd, TCAFDoc
2020-01-31 17:13:40 +03:00
kgv
00ea7f2676 0031321: C# wrapper - wrap AIS_ViewController
Added missing virtual destructor for AIS_ViewController.
2020-01-31 16:54:16 +03:00
nds
fe758dbe2c 0031322: Visualization, Select3D_SensitiveEntity - method NbSubElements() should be const
Set constant state for the method NbSubElement to be able to call it from other constant methods (e.g. DumpJson of Select3D_SensitiveEntity).
2020-01-30 18:58:32 +03:00
kgv
8811d6f2aa 0031332: Data Exchange - RWGltf_CafReader ignores bufferView.byteStride within glTF 2.0
RWGltf_GltfJsonParser::gltfParseBufferView() now reads byteStride parameter within bufferView.
2020-01-30 18:55:55 +03:00
nds
1939cfd9cb 0030904: Visualization - OSD_MemInfo provide Update with parameter of computation kind
Added method OSD_MemInfo::SetActive() for disabling specific counter.
2020-01-28 18:02:35 +03:00
iko
7860770232 0031275: Visualization, TKOpenGl - handle normal-map texture with Path-Tracing
Base normal map support has been implemented in path tracing (just geometry normal replacement).
Smooth normal adaptation has been implemeneted in order to avoid black areas artefacts during path tracing.
Tangent normal space calcuation has been moved to separate unified function.
Tangent space orthogonalization algorithm has been changed in order to handle all orientations and combinations of UV coordinates.
2020-01-24 16:35:41 +03:00
kgv
6216ed573e 0031312: Data Exchange - RWGltf_CafReader fails reading texture embedded into base64 bufferView
RWGltf_GltfJsonParser::gltfParseTexture() now handles images embedded into bufferView of non-glb file.
2020-01-23 18:13:19 +03:00
oan
973f7d55bd 0031258: Mesh - OCCT 7.4.0 VIS get wrong render data
Check intervals for infinite value causing exception in GeomLib::NormEstim
2020-01-22 10:16:28 +03:00
emv
0c74168c42 0031306: Modeling Algorithms - Incomplete result of Cut operation
The problem is fixed by #0029323. Integrating test case only.
2020-01-22 10:15:21 +03:00
kgv
3eba1c72ef 0031309: Data Exchange - RWObj_Reader fails to read mh03.obj with multi-line syntax
Standard_ReadLineBuffer::SetMultilineMode() now accepts a flag to put gap space while joining lines, enabled by default.
2020-01-21 13:04:46 +03:00
kgv
e83d440f92 0031304: Configuration - TKACIS building failure due to duplicated symbol GeomFillFusInt()
Added missing "static" to internal methods of GeomFill package.
2020-01-18 12:30:59 +03:00
iko
6558400123 0031302: Visualization, TKOpenGl - wrong tangent space calculation for normal maps
The normal after tangent space calculation has been reverted in order to be in right orientation.
The tangent space calculation has been modified in order to handle back faces with inverted normal.
2020-01-16 18:48:56 +03:00
ifv
389f5b59dd 0031260: Geom2dGcc_Circ2d2TanRad fails in this case (720)
Adaptor2d/Adaptor2d_OffsetCurve.cxx:
Function nbPoints(...) is modified

Test case added
2020-01-16 18:20:01 +03:00
ifv
08353e37cf 0031294: Modeling Algorithms - Regression relatively 7.3.0. Crash in method BRepPrimAPI_MakePrism::Generated(...)
BRepSweep_NumLinearRegularSweep.cxx: raising exeption is removed

Test case is added

QABugs_20.cxx - test command is added
2020-01-14 18:26:50 +03:00
iko
c8bead4752 0031293: Visualization, TKOpenGl - broken capping when PBR shading is ON
Division by 'w' component has been added in texture coordinates calculations in PBR functions.
2020-01-13 16:21:56 +03:00
osa
9df71488b3 0031295: Foundation Classes, BVH_Tools - incorrect detection of ray-box intersection 2020-01-13 16:18:55 +03:00
msv
ef59b5e064 0031292: Data Exchange - SIGSEGV on reading STEP file with references to invalid entities
Changes:

- in StepData_StepReaderData::ReadEntity, make sure that entity handle is not null before calling IsKind() of it.

- in StepData_StepReaderData::SetEntityNumbers, do not invert the sign of entity number of referenced parameter if the second pass is not required. Otherwise, the number -1 (obviously invalid) becomes 1 (invalid, but not obviously) without further correction of it.

- in StepData_UndefinedEntity::ReadRecord, consider the case when the entity number is positive but refers to non-existing entity. In this case literal value will be used instead of null entity for the problematic parameter.
2020-01-13 16:16:48 +03:00
oan
0c061f3d9d 0025287: BRepMesh_IncrementalMesh produces (way) out of tolerance mesh Added test case 2020-01-13 16:13:24 +03:00
iko
88b312d3a4 0031099: Visualization, TKOpenGl - support Point light source with artistic full cut-off distance
"Range" parameter of point light sources (positional and spot) concidering in PBR has been added.
Angular attenuation parameter of spot light in PBR has been reimplemented based on existing "concentration" parameter.
2020-01-13 16:07:19 +03:00
kgv
0858125fd4 0031284: Visualization - XCAFDoc_VisMaterialPBR lacks Index of Refraction
Added missing parameter.
2019-12-27 16:35:31 +03:00
mzernova
89d855ba58 0031225: Visualization, TKOpenGl - support cubemap for environment texture within Ray-Tracing
Ray-Tracing now handles IBL and background cubemaps in similar way as PBR.
Ambient light source is handled by Ray-Tracing in similar way as PBR,
e.g. as coefficient for environment map (IBL) or as constant light source.

Test script generating PBR spheres has been moved to Samples
and now shared by PBR and Path-Tracing tests.
2019-12-27 16:26:48 +03:00
kgv
d415125a68 0031274: Data Exchange - RWObj_Reader ignores usemtl with empty name
Fixed out of range access within pushMaterial().
2019-12-26 17:19:31 +03:00
razmyslovich
0da2ecac41 0031251: Add a new meshing parameter to enforce face linear deflection
Parameter has been renamed to ForceFaceDeflection. Added test case.

New parameter -force_face_def has been added to incmesh command.
2019-12-25 15:25:43 +03:00
ifv
bdd09cfaf4 0031242: Scaling with different coefficients along axes produces invalid shape
GeomConvert_1.cxx:
Creation periodic BSpline surfaces from trimmed periodic surface if trim is boundaries of periodic domain is allowed

BRepTools_NurbsConvertModification.cxx:
Checking domain of 2dCurves if surfaces are periodic is added

Test case tests/bugs/mesh/bug30008_2 is modified according to current behavior

Test case tests/bugs/modalg_7/bug31242 is added
2019-12-23 11:49:04 +03:00
kgv
9504a30d15 0031253: Visualization, TKOpenGl - phong shading GLSL compilation fail on Adreno 308
Removed initialization of global Normal variable outside of main() block.
occLight_IsHeadlight() flag is now packed into occLight_Position().w
2019-12-19 16:55:21 +03:00
jgv
9a1701fbcb 0030597: Result of BRepOffsetAPI_MakePipeShell doesn't match the given profiles
Modify the local function EdgeToBSpline of BRepFill_NSections to build a BSpline curve of general type for each curve of profile.
2019-12-19 16:53:36 +03:00
mzernova
c68c346d2b 0030600: Visualization, TKOpenGl - include GLES3/gl3.h instead of GLES2/gl2.h
Changed GLES2/gl2.h to GLES3/gl3.h.

OpenGl_Window_1.mm has been updated, now it is trying to create kEAGLRenderingAPIOpenGLES3 before trying to create kEAGLRenderingAPIOpenGLES2.
2019-12-19 16:50:16 +03:00
ifv
e2447a80ea 0031203: Test harness command "bsection" on the planar faces return only one vertex instead edge representing intersection line
BRepClass/BRepClass_FaceExplorer.cxx:
Protection against intersection of test ray with almost parallel edges is added.

SWDRAW/SWDRAW_ShapeFix.cxx: add tolerance as parameter in command checkfclass2d

tests/bugs/modalg_7/bug31203:
test case is added
2019-12-19 16:45:54 +03:00
oan
936ce1f273 0031199: BRepMesh fails on thin faces
Use real tolerance of a face to define threshold for tolerance of discrete model instead of empirical values based on discrete model itself
2019-12-19 16:30:06 +03:00
jgv
6ef7a1f9e5 0031187: Modeling Algorithms - Regression relatively 7.3.0. Unify same domain algorithm produces invalid shape.
Modify the local function ReconstructMissedSeam to build new seam edges correctly.
2019-12-18 19:42:50 +03:00
msv
23c2ae55c7 0031120: Memory leak in BRepOffsetAPI_MakeOffset
Add destructor of MAT2d_Mat2d - full removal of edges and bisectors.
2019-12-17 15:51:06 +03:00
abk
8bfae263c1 0031168: JT Import - cannot see properties attached to objects
Draw command GetNDStrings was improved to sort the properties by the keys and
skip conversions of the strings to type TCollection_AsciiString.

Certain Draw commands were corrected to use the Draw interpreter instead of "std::cout".

A Tcl procedure was created to compare two multi-line strings.
2019-12-14 13:52:16 +03:00
ma haidong
1c2ddf5612 0031231: Samples - the command "donl" in ModelingDemo.tcl should be "donly"
Fixed misprint in Tcl sample script.
2019-12-14 13:51:03 +03:00
kgv
5a8d30b87b 0030945: JT Import, JtProperty_LateLoaded - expose type of Deferred object
RWMesh_NodeAttributes has been extended with NamedData property for passing Metadata.

RWMesh_CafReader::addShapeIntoDoc() has been corrected to avoid
adding calling XCAFDoc_ShapeTool::AddSubShape() for sub-shape labels.
Attributes for Products and Instances are now set independently to shape labels.
Sharing of Compounds (previously always duplicated) as sub-Components has been fixed.

TDataStd_NamedData has been extended with interface for deferred data loading.
Setters have been corrected to avoid duplicating lookups within map.
2019-12-06 19:38:01 +03:00
kgv
b7b22996bb 0031227: Tests - log number of compared images into report 2019-12-06 19:32:37 +03:00
anv
552a74d829 0030889: ACIS Import - Incorrect result reading SAT and SAB files
Adapting CR30932 fix for a GeomLib approximator.
2019-12-06 19:32:36 +03:00
mzernova
c37bd936c3 0031213: Coding Rules, RWStl_Reader - misnamed variable THE_BUFFER
Renamed THE_BUFFER variable.
2019-12-06 19:32:35 +03:00
anv
4e8c1d8666 0031202: Shape Healing - FixMissingSeam creates degenerated edge
Adding tolerance to prevent degenerated cuts in cases where all vertex tolerance is covered by distance of the edge curve from vertex point.
2019-12-06 19:32:34 +03:00
iko
72f6dc612c 0031096: Visualization, TKOpenGl - support metallic-roughness texture mapping
OpenGl_ShaderManager - metallic-roughness, emissive, occlusion
and normal texture maps are now supported by PBR.
Emissive, occlusion and normal texture maps are now supported by Phong shading model.
Path-Tracing now handles metallic-roughness and emissive texture maps.

Graphic3d_TextureUnit enumeration has been extended by
new values corresponding to supported texture maps.

OpenGl_TextureSet and OpenGl_ShaderProgram have been extended with
bitmask Graphic3d_TextureSetBits identifying texture slots read from GLSL Program
and slots defined within Texture Set to avoid undefined behavior by binding mock textures.

OpenGl_TextureSet now duplicates texture unit information to handle
textures shared across multiple slots (like Occlusion [R] + Metallic-Roughness [GB]).

OpenGl_Context::BindTextures() has been extended with active GLSL program paramter
to set mock textures to texture units used by program but undefined by texture set.
OpenGl_Workspace::ApplyAspects() has been extended with parameter to avoid bining texture set.
2019-11-29 20:36:23 +03:00
mzernova
f051908edc 0030982: Visualization, OpenGl_View::MinMaxValues() - do not add background quad into depth range
Deleted adding background quad into depth range. Background is drawn in 2D coordinates. Fixed problem with using gradient background in tiles.
2019-11-29 20:19:42 +03:00
emv
420b38fde9 0031148: Modeling Algorithms - Offset adjacent co-planar faces with different offset values
Extend the Offset operation (Join Type "Intersection", mode "Complete") to allow different offset values on adjacent co-planar faces.
The gap between adjacent faces is closed by creating artificial face perpendicular to the face.

Adding test cases.
2019-11-29 10:06:22 +03:00
emv
34e7ac6817 0031201: Modeling Algorithms - Result of a section operation is incomplete
Fixing misprint - use the boundaries of the cylinder for Plane/Cylinder intersection.
Test cases for the issue.
2019-11-29 09:59:01 +03:00
osa
2b5a58a33c 0031186: Foundation Classes - add additional useful methods to BVH_Box.
Add Transform() and Transformed() methods by Mat4 for BVH_Box (only for 3D dimension).
Add PointBoxProjection() method to project point to box and RayBoxIntersection() method to compute hit time of ray-box intersection to BVH_Tools.
Add BVH_Ray class to define ray object.
2019-11-26 18:36:55 +03:00
kgv
e513a6c538 0031188: Draw Harness - enable colorized messages output to console by default
Message_PrinterOStream now uses colorized output by default.
DRAWEXE has been corrected to disabled colorized output
when it is called with -f argument to avoid spoiling testgrid HTML logs.
2019-11-26 18:35:38 +03:00
kgv
8c2d331426 0031007: Coding - eliminate warnings issued while compiling with -pedantic flag
Removed duplicating semicolons ;;.
Removed redundant semicolon at namespace closure.
2019-11-26 18:29:13 +03:00
mzernova
caee80f39f 0030697: Draw Harness - Draw_Printer should not be set to Message::DefaultMessenger() by default
Fixed bugs that occurred when using the default std::cout from Message::DefaultMessenger() instead of Draw_Printer

A dedicated option was added to Draw_ProgressIndicator, for outputting data to the tcl when performing tests

Added -tclOutput parameter to XProgress command
2019-11-23 16:09:07 +03:00
kgv
01b2f506d6 0030953: Data Exchange - implement export of mesh data into glTF 2.0 format
Added new class RWGltf_CafWriter for exporting XCAF document into glTF file
as well as Draw Harness command WriteGltf.

Added auxiliary method OSD_Path::FileNameAndExtension() splitting file name into Name and Extension.
2019-11-23 16:03:19 +03:00
vsv
df8c7e3e18 0031153: Visualization - Non clear highlighting of selected trihedron elements
AIS_Trihedron - removed extra fields holding highlight styles; standard styles are now used instead;
fixed unexpected modification of global aspects;
fixed unhighligting of selected plane within Shaded trihedron.

AIS_InteractiveContext now sets highlight color to highlight aspects, not only base color to drawer itself.
2019-11-21 17:43:07 +03:00
kgv
3f1675c941 0031174: Visualization - support user-provided stipple line patterns 2019-11-21 17:40:58 +03:00
kgv
6a56fe9240 0031178: Configuration, genproj - fix searching for zlib on Linux platform
zlib library is called libz on Linux.
2019-11-21 17:24:12 +03:00
mzernova
51ee6a7dbb 0030964: Data Exchange - use Standard_ReadLineBuffer within OBJ reader
Standard_ReadLineBuffer now supports a processing of the special multi-line case with \ at the end of the line.

Standard_RedLineBuffer was used to load Stl files
2019-11-20 17:08:31 +03:00
kgv
14a356b178 0031015: Visualization, TKOpenGl - OpenGl_WorldViewState does not cache inverted matrix
Implementation has been fixed to proprely set myInverseNeedUpdate flag.
2019-11-19 18:58:54 +03:00
kgv
4eff0c0480 0031175: Visualization - support dumping RED channel as grayscale image
Graphic3d_BufferType has been extended by Graphic3d_BT_Red.
2019-11-19 10:37:54 +03:00
abv
8f00325d73 0031171: Draw - support Unicode input / output in console on Windows
System console is configured at DRAW start to use UTF-8 encoding, for cout and cin to deal correctly with Unicode symbols.
Use of std::wcout is avoided as it leads to corrupted output.

Command testgrid is improved to enforce UTF-8 encoding in child DRAW processes to preserve Unicode symbols in captured output.

Test bugs fclasses bug22125 is refactored:
- avoid dependency on external data file
- avoid producing snapshot
- check that Unicode name of the file created by OCCT procedure matches the name interpreted by Tcl functions
2019-11-17 17:52:38 +03:00
kgv
9a90a4524e 0031159: Visualization - Font_FontMgr skips sub-faces within .ttc font collections
Font_SystemFont now defines Face Id in addition to file path.
Font_FontMgr::CheckFont() has been extended to return the list of Faces from font collections.
2019-11-15 16:51:15 +03:00
abv
31a5a359bb 0031144: Shape Healing - ShapeAnalysis::OuterWire() infinite loop on solid obtained from IFC
Implementation of ShapeAnalysis::OuterWire() is revised to avoid infinite cycle if face contains internal vertex.
2019-11-15 16:37:25 +03:00
jgv
bf97419a18 0030958: BRepOffsetAPI_ThruSections operation raises an exception while building history
Correct methods Build and Generated:
use BRepTools_WireExplorer instead of TopExp_Explorer or TopoDS_Iterator, for compatibility with previous computations.
2019-11-14 22:40:01 +03:00
gka
4c26106f76 0031140: Draw command "cirtang" raises exception on the parallel curves
Exception in the algorithm Geom2dGcc_Circ2dTanOnRadGeo raised because the number of solutions exceeded the size of reserved array for solutions. A check has been added to forbid adding solutions outside of allocated place.

The similar protection has been done in other algorithms of this package.
2019-11-13 18:38:28 +03:00
kgv
15e4e6a23e 0031118: Visualization - Font_FontMgr skips fonts with unknown styles like Narrow or Black
Extended Style name is now appended to Family name for unique identification of the font.
vfont -find now accepts mask to search the font and returns family name.
2019-11-13 18:34:33 +03:00
kgv
6b467e52bb 0031137: Modeling Data, BinTools_ShapeSet - avoid allocation of temporary arrays
BinTools_ShapeSet now defines maps with proper types instead of Standard_Transient.
BinTools_ShapeSet now avoids allocation of temporary arrays while reading
triangulation and polygonal data.

Classes Poly_Triangle, Poly_PolygonOnTriangulation, Poly_Polygon3D and Poly_Polygon2D
have been cleared from .lxx files and extended by new methods for preallocating and filling array,
as alternative to passing arrays by copy.

wavefront command - export "f" instead of obsolete "fo" keys into file.
BinTools - added missing tools for reading/writing short reals.
2019-11-09 19:12:47 +03:00
kgv
08b438b076 0031138: Visualization - Image_AlienPixMap fails to load PNG image with palette
Added fallback code converting unsupported pixel format into RGB24 using FreeImage itself.
2019-11-07 20:19:38 +03:00
kgv
a14f2b4722 0031139: Data Exchange - fix misprint in RWObj_CafReader
RWObj_CafReader::BindNamedShape(), added missing bind to material map.
XCAFDoc_VisMaterial::ConvertToCommonMaterial()/::ConvertToPbrMaterial(), added copying of base color texture.
XCAFPrs_DocumentExplorer now properly fills XCAFDoc_VisMaterial property of XCAFPrs_Style.
2019-11-07 20:18:25 +03:00
kgv
a1a9b24952 0031135: Visualization, TKOpenGl - texture sRGB -> linear conversion is applied twice by Path Tracer
Removed from PathtraceBase.fs redundant gamma correction applied to texture.
2019-11-06 19:33:36 +03:00
abv
f979709590 0031038: Draw - adaptations for running tests with CLang address sanitizer
New optional environment variable CSF_CPULIMIT_FACTOR is introduced, allowing scaling the argument given to DRAW command cpulimit by specified factor.

Command testgrid is extended by two new options:
- -skipped: to re-run tests skipped in specified log
- -skip: to skip specified number of tests in the beginning of test sequence

Temporary Tcl scripts generated by test system are now removed from the test log directories immediately after the test execution, to save disk space.

Advises on use of CLang sanitizers are added in guide "Debugging hints and tips".
2019-11-06 19:22:33 +03:00
oan
e9d05765c2 0031131: [REGRESSION] Mesh - location of Wire affects Poly_Polygon3D
Use TopoDS_Edge without location in case of free edges to produce Poly_Polygon3D without offset.
2019-11-06 19:19:47 +03:00
oan
7756fc599d 0031125: BRepMesh_IncrementalMesh crash in constructor for empty compound shape
Added check for cases of empty shapes producing null models.
NoError status is returned as far as empty compounds are generally coorect shapes.
2019-11-06 19:17:24 +03:00
abv
b31fbc832d 0031124: Configuration - linker errors when building with CLang on Windows
Standard_EXPORT is added in declaration of virtual methods where it was missing, to allow creation of sub-classes in other DLLs.
In some classes in OpenGl package Standard_EXPORT is added for all methods to make these classes usable in other DLLs.
2019-11-04 14:08:18 +03:00
abv
1bd04b5a02 0031060: Configuration - Support building with CLang compiler under VS 2019
Build tools are updated to support building with Visual Studion 2019 toolset ClangCL (LLVM clang-cl):
- In CMake builds, use of unsupported option "-std=c++0x" is avoided
- Tool genconf recognizes availability of ClangCL toolset and proposes it in the list
- Tool genproj recognizes new compiler specification VCVER=vclang and generates VS 2019 projects for it

Note that vclang configuration puts binaries to folder "vc14" as it is compatible with vc14 CRT.

Code is updated to build with Clang for Windows without errors and warnings:
- In BVH classes, pure virtual destructors are replaced by empty ones, to avoid bogus compiler warning
- In .lex files, pragmas are added to disable warnings in parser code
- In OSD, signature of function _osd_wnt_set_error() is corrected to avoid warning on incorrect use of va_args (undefined behavior)
- In OSD_Host, OSD_Parallel_TBB, warnings on usage of deprecated function are disabled
- In Quantity_ColorRGBA and ViewerTest_CmdParser, incorrect use of predefined macro __FUNCTION__ assuming it was a string literal is avoided
- In Standard_Macro.hxx, code is reordered to handle Clang for Windows appropriately
- In AdvApp2Var_SysBase.hxx, inclusion of obsolete (MSVC-specific) header file is replaced by Standard_TypeDef.hxx
- In Standard_ErrorHandler.hxx, empty statements added to avoid warning on unused class fields
- In IVtkDraw and ViewerTest, interface is corrected to use actual type avoiding unnecessary type casts

Off-topic: corrections of some errors (uninitialized class fields) reported by VS Code Analysis in TKernel
2019-11-03 21:47:59 +03:00
2763 changed files with 71428 additions and 138429 deletions

View File

@@ -3,6 +3,7 @@ StdResource
SHMessage
Textures
Shaders
XRResources
XSMessage
XSTEPResource
XmlOcafResource

View File

@@ -1,4 +1,4 @@
TModelingData TKShapeView
TModelingData TKShapeView TKMessageModel TKMessageView
TVisualization TKView TKVInspector
TApplicationFramework TKTreeModel TKTInspectorAPI TKDFBrowser
TTool TKTInspector TKToolsDraw TInspectorEXE

View File

@@ -108,6 +108,7 @@ n BRepMesh
n BRepMeshData
n BRepOffset
n BRepOffsetAPI
n BRepPreviewAPI
n BRepPrim
n BRepPrimAPI
n BRepProj
@@ -201,6 +202,7 @@ n InterfaceGraphic
n AIS
n Aspect
n DsgPrs
n PrsDim
n Graphic3d
n Image
n Media
@@ -214,13 +216,13 @@ n SelectBasics
n SelectMgr
n StdPrs
n StdSelect
n TColQuantity
n V3d
n WNT
n Xw
n Cocoa
r Textures
r Shaders
r XRResources
t TKMeshVS
t TKOpenGl
t TKD3DHost
@@ -443,3 +445,23 @@ t TKRWMesh
n RWGltf
n RWMesh
n RWObj
n DFBrowser
n DFBrowserPane
n DFBrowserPaneXDE
n ShapeView
n TInspector
n TInspectorAPI
x TInspectorEXE
t TKDFBrowser
t TKShapeView
t TKTInspector
t TKTInspectorAPI
t TKToolsDraw
t TKTreeModel
t TKView
t TKVInspector
n ToolsDraw
n TreeModel
n View
n ViewControl
n VInspector

View File

@@ -130,7 +130,9 @@ elseif ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
if (APPLE)
# CLang can be used with both libstdc++ and libc++, however on OS X libstdc++ is outdated.
set (CMAKE_CXX_FLAGS "-std=c++0x -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
else()
elseif(NOT WIN32)
# CLang for Windows (at least CLang 8.0 distributed with VS 2019)
# does not support option "-std=c++0x"
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
endif()
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)

View File

@@ -7,7 +7,8 @@ if (NOT DEFINED ${3RDPARTY_QT_DIR} AND ${3RDPARTY_QT_DIR} STREQUAL "")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME)
if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "")
message (FATAL_ERROR "... Qt root directory was not found")
set (3RDPARTY_QT_DIR "" CACHE PATH "The directory containing qt")
message (FATAL_ERROR "Could not find used third-party product: 3RDPARTY_QT_DIR")
endif()
# Combine directory name with absolute path and show in GUI
@@ -31,4 +32,10 @@ if (NOT ${Qt5_FOUND})
#message (STATUS "Qt4 cmake configuration")
else()
#message (STATUS "Qt5 cmake configuration")
endif()
endif()
if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR}/bin")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_QT_DLL_DIR)
endif()

View File

@@ -82,6 +82,11 @@ if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Micr
lappend ::SYS_VC_LIST "vc142-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset ClangCL)"
lappend ::SYS_VC_LIST "vclang"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
# detect installed Visual Studio instances from global environment
if { [info exists ::env(VS140COMNTOOLS)] } {
@@ -182,6 +187,9 @@ proc wokdep:gui:UpdateList {} {
if { "$::HAVE_FFMPEG" == "true" } {
wokdep:SearchFFmpeg anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_OPENVR" == "true" } {
wokdep:SearchOpenVR anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_TBB" == "true" } {
wokdep:SearchTBB anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
@@ -193,7 +201,11 @@ proc wokdep:gui:UpdateList {} {
}
if { "$::HAVE_ZLIB" == "true" } {
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "zlib" "zlib.h" "zlib" {"zlib"}
set aCheckLib "z"
if { "$::tcl_platform(platform)" == "windows" } {
set aCheckLib "zlib"
}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "zlib" "zlib.h" "$aCheckLib" {"zlib"}
}
if { "$::HAVE_LIBLZMA" == "true" } {
set aCheckLib "lzma"
@@ -214,9 +226,14 @@ proc wokdep:gui:UpdateList {} {
wokdep:SearchRapidJson anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::CHECK_QT4" == "true" } {
wokdep:SearchQt4 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
if {"$::BUILD_Inspector" == "true" } {
set ::CHECK_QT "true"
}
if { "$::CHECK_QT" == "true" } {
wokdep:SearchQt anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::CHECK_JDK" == "true" } {
wokdep:SearchJDK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
@@ -458,6 +475,8 @@ checkbutton .myFrame.myChecks.myFImageCheck -offvalue "false" -onvalue "true
ttk::label .myFrame.myChecks.myFImageLbl -text "Use FreeImage"
checkbutton .myFrame.myChecks.myTbbCheck -offvalue "false" -onvalue "true" -variable HAVE_TBB -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myTbbLbl -text "Use Intel TBB"
checkbutton .myFrame.myChecks.myOpenVrCheck -offvalue "false" -onvalue "true" -variable HAVE_OPENVR -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myOpenVrLbl -text "Use OpenVR"
if { "$::tcl_platform(os)" != "Darwin" } {
checkbutton .myFrame.myChecks.myGlesCheck -offvalue "false" -onvalue "true" -variable HAVE_GLES2 -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myGlesLbl -text "Use OpenGL ES"
@@ -485,11 +504,16 @@ ttk::label .myFrame.myChecks.myLzmaLbl -text "Use liblzma"
checkbutton .myFrame.myChecks.myE57Check -offvalue "false" -onvalue "true" -variable HAVE_E57 -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myE57Lbl -text "Use E57"
checkbutton .myFrame.myChecks.myQt4Check -offvalue "false" -onvalue "true" -variable CHECK_QT4 -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myQt4Lbl -text "Search Qt4"
checkbutton .myFrame.myChecks.myQtCheck -offvalue "false" -onvalue "true" -variable CHECK_QT -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myQtLbl -text "Search Qt"
checkbutton .myFrame.myChecks.myJDKCheck -offvalue "false" -onvalue "true" -variable CHECK_JDK -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myJDKLbl -text "Search JDK"
if { "$::tcl_platform(platform)" == "windows" } {
checkbutton .myFrame.myChecks.myInspectorBuild -offvalue "false" -onvalue "true" -variable BUILD_Inspector -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myInspectorLbl -text "Build Inspector"
}
# Additional headers search paths
ttk::label .myFrame.myIncLbl -text "Additional headers search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myIncScrl -command ".myFrame.myIncList yview"
@@ -593,8 +617,8 @@ if { "$::tcl_platform(os)" != "Darwin" } {
grid .myFrame.myChecks.myZLibCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myZLibLbl -row $aCheckRowIter -column 7 -sticky w
grid .myFrame.myChecks.myQt4Check -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myQt4Lbl -row $aCheckRowIter -column 13 -sticky w
grid .myFrame.myChecks.myQtCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myQtLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myFFmpegCheck -row $aCheckRowIter -column 0 -sticky e
@@ -616,9 +640,16 @@ grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myOpenVrCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myOpenVrLbl -row $aCheckRowIter -column 5 -sticky w
grid .myFrame.myChecks.myE57Check -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myE57Lbl -row $aCheckRowIter -column 7 -sticky w
if { "$::tcl_platform(platform)" == "windows" } {
grid .myFrame.myChecks.myInspectorBuild -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myInspectorLbl -row $aCheckRowIter -column 13 -sticky w
}
incr aCheckRowIter
# Additional headers search paths

View File

@@ -68,7 +68,7 @@ if { [info exists ::env(SHORTCUT_HEADERS)] } {
}
# fetch environment variables (e.g. set by custom.sh or custom.bat) and set them as tcl variables with the same name
set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_E57 HAVE_RAPIDJSON HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo}
set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_E57 HAVE_RAPIDJSON HAVE_OPENVR HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo BUILD_Inspector}
foreach anEnvIter $THE_ENV_VARIABLES {
set ${anEnvIter} "false"
if { [info exists ::env(${anEnvIter})] } {
@@ -241,7 +241,11 @@ proc wokdep:Preferred {theList theCmpl theArch} {
# keep only two first digits in "vc141"
if { ! [regexp {^vc[0-9][0-9]} $theCmpl aCmpl] } {
set aCmpl $theCmpl
if { [regexp {^vclang} $theCmpl] } {
set aCmpl vc14
} else {
set aCmpl $theCmpl
}
}
set aShortList {}
@@ -621,6 +625,59 @@ proc wokdep:SearchFFmpeg {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBi
return "$isFound"
}
# Search OpenVR SDK placement
proc wokdep:SearchOpenVR {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
upvar $theErrInc anErrInc
upvar $theErrLib32 anErrLib32
upvar $theErrLib64 anErrLib64
upvar $theErrBin32 anErrBin32
upvar $theErrBin64 anErrBin64
set isFound "true"
set anOpenVrHPath [wokdep:SearchHeader "openvr.h"]
if { "$anOpenVrHPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{openvr}*] "$::VCVER" "$::ARCH" ]
if { "$aPath" != "" && [file exists "$aPath/include/openvr.h"] } {
lappend ::CSF_OPT_INC "$aPath/include"
} elseif { "$aPath" != "" && [file exists "$aPath/headers/openvr.h"] } {
lappend ::CSF_OPT_INC "$aPath/headers"
} else {
lappend anErrInc "Error: 'openvr.h' not found (OpenVR)"
set isFound "false"
}
}
set aPlatform "unknown"
if { "$::tcl_platform(platform)" == "windows" } {
set aPlatform "win"
} elseif { "$::tcl_platform(os)" == "Darwin" } {
set aPlatform "osx"
} elseif { "$::tcl_platform(os)" == "Linux" } {
set aPlatform "linux"
}
foreach anArchIter {64 32} {
set anOpenVrLibPath [wokdep:SearchLib "openvr_api" "$anArchIter"]
if { "$anOpenVrLibPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{openvr}*] "$::VCVER" "$anArchIter" ]
set anOpenVrLibPath [wokdep:SearchLib "openvr_api" "$anArchIter" "$aPath/lib/${aPlatform}${anArchIter}"]
set anOpenVrLibPath2 [wokdep:SearchLib "openvr_api" "$anArchIter" "$aPath/lib"]
if { "$anOpenVrLibPath" != "" } {
lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib/${aPlatform}${anArchIter}"
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin/${aPlatform}${anArchIter}"
} elseif { "$anOpenVrLibPath2" != "" } {
lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
} else {
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}openvr_api.${::SYS_LIB_SUFFIX}' not found (OpenVR)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
}
return "$isFound"
}
# Search TBB library placement
proc wokdep:SearchTBB {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
upvar $theErrInc anErrInc
@@ -631,7 +688,11 @@ proc wokdep:SearchTBB {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
# keep only two first digits in "vc141"
if { ! [regexp {^vc[0-9][0-9]} ${::VCVER} aVcLib] } {
set aVcLib ${::VCVER}
if { [regexp {^vclang} ${::VCVER}] } {
set aVcLib vc14
} else {
set aVcLib ${::VCVER}
}
}
set isFound "true"
@@ -1014,8 +1075,8 @@ proc wokdep:SearchVTK {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
return "$isFound"
}
# Search Qt4 libraries placement
proc wokdep:SearchQt4 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
# Search Qt libraries placement
proc wokdep:SearchQt {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
upvar $theErrInc anErrInc
upvar $theErrLib32 anErrLib32
upvar $theErrLib64 anErrLib64
@@ -1023,53 +1084,46 @@ proc wokdep:SearchQt4 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
upvar $theErrBin64 anErrBin64
set isFound "true"
set aQMsgBoxHPath [wokdep:SearchHeader "QtGui/qmessagebox.h"]
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt}*] "$::VCVER" "$::ARCH" ]
set aQMsgBoxHPath [wokdep:SearchHeader "QtGui/qguiapplication.h"]
if { "$aQMsgBoxHPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$::ARCH" ]
if { "$aPath" != "" && [file exists "$aPath/include/QtGui/qmessagebox.h"] } {
if { "$aPath" != "" && [file exists "$aPath/include/QtGui/qguiapplication.h"] } {
lappend ::CSF_OPT_INC "$aPath/include"
lappend ::CSF_OPT_INC "$aPath/include/Qt"
lappend ::CSF_OPT_INC "$aPath/include/QtGui"
lappend ::CSF_OPT_INC "$aPath/include/QtCore"
lappend ::CSF_OPT_INC "$aPath/include/QtWidgets"
lappend ::CSF_OPT_INC "$aPath/include/QtXml"
} else {
if { [file exists "/usr/include/qt4/QtGui/qmessagebox.h"] } {
lappend ::CSF_OPT_INC "/usr/include/qt4"
lappend ::CSF_OPT_INC "/usr/include/qt4/Qt"
lappend ::CSF_OPT_INC "/usr/include/qt4/QtGui"
lappend ::CSF_OPT_INC "/usr/include/qt4/QtCore"
} else {
lappend anErrInc "Error: 'QtGui/qmessagebox.h' not found (Qt4)"
lappend anErrInc "Error: 'QtGui/qguiapplication.h' not found"
set isFound "false"
}
}
}
set aQtGuiLibName "QtGui"
if { "$::tcl_platform(platform)" == "windows" } {
set aQtGuiLibName "QtGui4"
set aQtGuiLibName "Qt5Gui"
}
foreach anArchIter {64 32} {
set aQMsgBoxLibPath [wokdep:SearchLib "${aQtGuiLibName}" "$anArchIter"]
if { "$aQMsgBoxLibPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$anArchIter" ]
set aQMsgBoxLibPath [wokdep:SearchLib "${aQtGuiLibName}" "$anArchIter" "$aPath/lib"]
if { "$aQMsgBoxLibPath" != "" } {
lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
} else {
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aQtGuiLibName}.${::SYS_LIB_SUFFIX}' not found (Qt4)"
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aQtGuiLibName}.${::SYS_LIB_SUFFIX}' not found (Qt)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
if { "$::tcl_platform(platform)" == "windows" } {
set aQMsgBoxDllPath [wokdep:SearchBin "QtGui4.dll" "$anArchIter"]
set aQMsgBoxDllPath [wokdep:SearchBin "${aQtGuiLibName}.dll" "$anArchIter"]
if { "$aQMsgBoxDllPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$anArchIter" ]
set aQMsgBoxDllPath [wokdep:SearchBin "QtGui4.dll" "$anArchIter" "$aPath/bin"]
set aQMsgBoxDllPath [wokdep:SearchBin "${aQtGuiLibName}.dll" "$anArchIter" "$aPath/bin"]
if { "$aQMsgBoxDllPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
} else {
lappend anErrBin$anArchIter "Error: 'QtGui4.dll' not found (Qt4)"
lappend anErrBin$anArchIter "Error: '${aQtGuiLibName}.dll' not found (Qt)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -25,6 +25,7 @@ set "HAVE_D3D=false"
set "HAVE_ZLIB=false"
set "HAVE_LIBLZMA=false"
set "HAVE_RAPIDJSON=false"
set "HAVE_OPENVR=false"
set "HAVE_E57=false"
set "CSF_OPT_INC="
set "CSF_OPT_LIB32="
@@ -77,6 +78,9 @@ if "%VCVER:~-4%" == "-uwp" (
set VCLIB=%VCLIB%-uwp
set VCPROP=Universal
)
if "%VCFMT%" == "vclang" (
set VCLIB=vc14
)
rem echo VCVER=%VCVER% VCFMT=%VCFMT% VCLIB=%VCLIB% VCPROP=%VCPROP%
rem ----- Parsing of Visual Studio platform -----
@@ -106,6 +110,10 @@ if not "%DevEnvDir%" == "" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "vclang" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else (
@@ -118,6 +126,7 @@ if not "%DevEnvDir%" == "" (
echo vc14 = VS 2015
echo vc141 = VS 2017
echo vc142 = VS 2019
echo vclang = VS 2019 with ClangCL toolset
exit /B
)
@@ -147,6 +156,11 @@ if /I "%VCFMT%" == "vc9" (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "vclang" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=ClangCL"
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else (
@@ -176,6 +190,7 @@ if ["%HAVE_D3D%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DH
if ["%HAVE_ZLIB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_ZLIB" & set "CSF_DEFINES=HAVE_ZLIB;%CSF_DEFINES%"
if ["%HAVE_LIBLZMA%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_LIBLZMA" & set "CSF_DEFINES=HAVE_LIBLZMA;%CSF_DEFINES%"
if ["%HAVE_RAPIDJSON%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_RAPIDJSON" & set "CSF_DEFINES=HAVE_RAPIDJSON;%CSF_DEFINES%"
if ["%HAVE_OPENVR%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_OPENVR" & set "CSF_DEFINES=HAVE_OPENVR;%CSF_DEFINES%"
if ["%HAVE_E57%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_E57" & set "CSF_DEFINES=HAVE_E57;%CSF_DEFINES%"
rem Eliminate VS warning

View File

@@ -16,6 +16,7 @@ export HAVE_GLES2="false";
export HAVE_ZLIB="false";
export HAVE_LIBLZMA="false";
export HAVE_RAPIDJSON="false";
export HAVE_OPENVR="false";
export HAVE_E57="false";
export MACOSX_USE_GLX="false";
export CSF_OPT_INC=""
@@ -106,6 +107,7 @@ if [ "$HAVE_VTK" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -D
if [ "$HAVE_ZLIB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_ZLIB"; fi
if [ "$HAVE_LIBLZMA" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_LIBLZMA"; fi
if [ "$HAVE_RAPIDJSON" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_RAPIDJSON"; fi
if [ "$HAVE_OPENVR" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENVR"; fi
if [ "$HAVE_E57" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_E57"; fi
# Option to compile OCCT with X11 libs on Mac OS X
if [ "$MACOSX_USE_GLX" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"; fi

View File

@@ -159,7 +159,7 @@
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
<OutputFile>.\..\..\..\win32\__VCVER__\bind\__TKNAM__.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\win32\__VCVER__\libd;$(CSF_OPT_LIB32D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -255,7 +255,7 @@
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
<OutputFile>.\..\..\..\win64\__VCVER__\bind\__TKNAM__.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\win64\__VCVER__\libd;$(CSF_OPT_LIB64D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

View File

@@ -149,7 +149,7 @@
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\win32\__VCVER__\libd;$(CSF_OPT_LIB32D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -238,7 +238,7 @@
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\win64\__VCVER__\libd;$(CSF_OPT_LIB64D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 11 KiB

BIN
data/images/hatch_1_.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

BIN
data/images/hatch_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

BIN
data/images/hatch_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

BIN
data/images/hatch_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

BIN
data/images/hatch_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 B

BIN
data/images/hatch_6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 B

BIN
data/images/hatch_7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 633 B

BIN
data/images/hatch_8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -64,7 +64,7 @@ Then makefiles will appear in the build folder (e.g. <i> D:/occt/build-android <
Alternatively one may specify the values without a toolchain file:
> cmake -G "MinGW Makefiles" -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=D:/DevTools/android-ndk-r13b -DCMAKE_ANDROID_STL_TYPE=gnustl_shared -DCMAKE_SYSTEM_VERSION=15 -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_MAKE_PROGRAM=D:/DevTools/MinGW/bin/mingw32-make.exe -D3RDPARTY_DIR=D:/occt-3rdparty D:/occt
> cmake -G "MinGW Makefiles" -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=D:/DevTools/android-ndk-r13b -DCMAKE_ANDROID_STL_TYPE=gnustl_shared -DCMAKE_SYSTEM_VERSION=21 -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_MAKE_PROGRAM=D:/DevTools/MinGW/bin/mingw32-make.exe -D3RDPARTY_DIR=D:/occt-3rdparty D:/occt
@figure{/dev_guides/building/android/images/android_image006.png}

View File

@@ -150,7 +150,8 @@ Steps to prepare dump of the object into json:
1. Create method <b>DumpJson</b>. The method should accept the output stream and the depth for the fields dump.
Depth, equal to zero means that only fields of this class should be dumped. Default value -1 means that whole tree of dump will be built recursively calling dump of all fields.
2. Put into the first row of the method <b>OCCT_DUMP_CLASS_BEGIN</b>. This macro creates a local variable, that will open Json structure on start, and close on exit from this method.
2. Put into the first row of the method <b>OCCT_DUMP_CLASS_BEGIN</b> or <b>OCCT_DUMP_TRANSIENT_CLASS_BEGIN</b> (for Standard_Transient objects).
This macro appends class name into output stream.
3. Add several macro to store field values.
@@ -368,3 +369,53 @@ Each counter has its name shown when the collected statistics are printed.
In DRAW, use command *dperf* to print all performance statistics.
Note that performance counters are not thread-safe.
@section occt_debug_sanitizers Use of compiler sanitizers
GCC and Clang compilers provide options for instrumenting the code with the tools intended for detection of run-time errors, called sanitizers.
This section provides some hints for using sanitizers for detecting possible errors in OCCT code.
@subsection occt_debug_sanitizers_linux Linux
Example of configuration steps for Ubuntu:
1. In CMake configuration:
- Use up-to-date version of the GCC or CLang compiler; make sure that if CMAKE_CXX_COMPILER is set to C++ compiler (e.g. "clang++-6.0") and CMAKE_C_COMPILER is set to C compiler (e.g. "clang-6.0")
- Ensure that CMAKE_LINKER is set to the C++ linker bundled with compiler (e.g. clang++-6.0); this is important to avoid linking problems
- For building with Address sanitizer, set CMAKE_CXX_FLAGS and CMAKE_C_FLAGS to "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls"
- For building with Undefined Behavior sanitizer, set CMAKE_CXX_FLAGS and CMAKE_C_FLAGS to "-fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls"
- Set CMAKE_BUILD_TYPE to RelWithDebInfo to get more informative stack traces on errors
2. Build as usual (make)
Be prepared that it works much slower than normal build and consumes more disk space.
3. Before running executable, make sure that "llvm-symbolizer" is in PATH; this is necessary to get human-readable stack traces. The tool must have exactly that name.
If it is installed in common folder (/usr/bin or similar) with different name, one option is to create a symlink, for instance:
> sudo ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer
Alternatively, add directory where actual llvm-symbolizer is located (such as /usr/lib/llvm-6.0/bin) to the PATH variable.
4. Set environment variable to disable memory leaks detection (they seem to be reported for every global variable at exit, not much useful):
> export ASAN_OPTIONS=detect_leaks=0
5. Set environment variable CSF_CPULIMIT_FACTOR to reasonably large number to increase the time limits for program execution (used by OCCT tests) to compensate the performance penalty introduced by sanitizers:
> export CSF_CPULIMIT_FACTOR=20
6. When using UBSan, set environment variable UBSAN_OPTIONS to get stack traces:
> export UBSAN_OPTIONS=print_stacktrace=1
7. Run DRAW and perform tests as usual, keeping in mind that running with sanitizer is much heavier than normal build:
> ./draw.sh relwithdeb <br>
> Draw[]> testgrid -parallel 0
Note that when running tests under sanitizers, behavior may be different.
Known problems (as of CLang 6.0) are:
- Software signals (access violation etc.) are not handled
- Heap memory usage always reports zero
@subsection occt_debug_sanitizers_windows Windows
Though CLang toolset is available in Visual Studio 2015 and newer, sanitizer do not seem to be available out of the box (last tested with VS 2019 16.2.3).

View File

@@ -1888,3 +1888,94 @@ Unexpected const-ness of Aspect_Window::DoResize() method has been removed, so t
@subsection upgrade_750_rename Renaming of types
Enumeration BRepOffset_Type is renamed to ChFiDS_TypeOfConcavity.
@subsection upgrade_750_tkv3d TKV3d/TKService toolkits changes
The following changes could be highlighted while porting:
* *Prs3d::GetDeflection()* has been moved to *StdPrs_ToolTriangulatedShape::GetDeflection()*.
* *Prs3d_ShapeTool* has been moved to *StdPrs_ShapeTool*.
* *StdSelect_ViewerSelector3d* has been moved to *SelectMgr_ViewerSelector3d*.
* *Font_BRepFont* has been moved to *StdPrs_BRepFont*.
* Visualization classes now use *TopLoc_Datum3D* (from *TKMath*) instead of *Geom_Transformation* (from *TKG3d*) as smart pointer to *gp_Trsf*.
This is rather an internal change, but some applications might need to be updated.
@subsection upgrade_750_hlrangle Prs3d_Drawer deviation angle
Properties Prs3d_Drawer::HLRAngle() and Prs3d_Drawer::HLRDeviationCoefficient() have been removed from classes *Prs3d_Drawer*, *AIS_Shape* and *AIS_InteractiveContext*.
Prs3d_Drawer::DeviationAngle() should be now used instead of Prs3d_Drawer::HLRAngle() and Prs3d_Drawer::DeviationCoefficient() instead of Prs3d_Drawer::HLRDeviationCoefficient().
The default value of Prs3d_Drawer::DeviationAngle() property has been changed from 12 to 20 degrees to match removed Prs3d_Drawer::HLRAngle(), previously used as input for triangulation algorithm.
@subsection upgrade_750_hlrprs Changes in HLR presentation API
Methods computing HLR presentation within *PrsMgr_PresentableObject::Compute()* have been renamed to *PrsMgr_PresentableObject::computeHLR()*
and now accept *Graphic3d_Camera* object instead of removed *Prs3d_Projector*.
@subsection upgrade_750_dimensions Dimension and Relation presentations moved from AIS to PrsDim
Presentation classes displaying Dimensions and Relations have been moved from *AIS* package to *PrsDim*.
Corresponding classes should be renamed in application code (like *AIS_LengthDimension* -> *PrsDim_LengthDimension*).
@subsection upgrade_750_sensitiveEntity Select3D_SensitiveEntity interface change
The method Select3D_SensitiveEntity::NbSubElements() has been changed to be constant. Select3D_SensitiveEntity subclasses at application level should be updated accordingly.
@subsection upgrade_750_Booleans Changes in Boolean operations algorithm
* TreatCompound method has been moved from *BOPAlgo_Tools* to *BOPTools_AlgoTools*. Additionally, the map parameter became optional:
~~~~
void BOPTools_AlgoTools::TreatCompound (const TopoDS_Shape& theS,
TopTools_ListOfShape& theLS,
TopTools_MapOfShape* theMap = NULL);
~~~~
@subsection upgrade_750_Adaptor2d_OffsetCurve Offset direction change
Offset direction, which used in class Adaptor2d_OffsetCurve for evaluating values and derivatives of offset curve is unified for offset direction used in class Geom2d_OffsetCurve: now offset direction points to outer ("right") side of base curve instead of the previously used inner ("left") side. Old usage of class in any application should be changed something like that:
Adaptor2d_OffsetCurve aOC(BaseCurve, Offset) --> Adaptor2d_OffsetCurve aOC(BaseCurve, -Offset)
@subsection upgrade_750_message_messenger Message_Messenger interface change
Operators << with left argument *Handle(Message_Messenger)*, used to output messages with
a stream-like interface, have been removed.
This functionality is provided now by separate class *Message_Messenger::StreamBuffer*.
That class contains a stringstream buffer which can be filled using standard stream
operators. The string is sent to a messenger on destruction of the buffer object,
call of its method Flush(), or using operator << with one of ostream manipulators
(*std::endl, std::flush, std::ends*). Manipulator *Message_EndLine* has been removed,
*std::endl* should be used instead.
New methods *SendFail(), SendAlarm(), SendWarning(), SendInfo()*, and *SendTrace()* are
provided in both *Message_Messenger* class and as static functions in *Message* package
(short-cuts to default messenger), returning buffer object for the output of
corresponding type of the message.
The code that used operator << for messenger, should be ported as follows.
Before the change:
~~~~~
Handle(Message_Messenger) theMessenger = ...;
theMessenger << "Value = " << anInteger << Message_EndLine;
~~~~~
After the change, single-line variant:
~~~~~
Handle(Message_Messenger) theMessenger = ...;
theMessenger->SendInfo() << "Value = " << anInteger << std::endl;
~~~~~
After the change, extended variant:
~~~~~
Handle(Message_Messenger) theMessenger = ...;
Message_Messenger::StreamBuffer aSender = theMessenger->SendInfo();
aSender << "Array: [ ";
for (int i = 0; i < aNb; ++i) { aSender << anArray[i] << " "; }
aSender << "]" << std::endl; // aSender can be used further for other messages
~~~~~
@subsection upgrade_750_message_printer Message_Printer interface change
Previously, sub-classes of *Message_Printer* have to provide a triplet of *Message_Printer::Send()* methods accepting different string representations: TCollection_AsciiString, TCollection_ExtendedString and Standard_CString.
*Message_Printer* interface has been changed, so that sub-classes now have to implement only single method *Message_Printer::send()* accepting TCollection_AsciiString argument and having no Endl flag, which has been removed.
Old three Message_Printer::Send() methods remain defined virtual with unused last argument and redirecting to new send() method by default.

View File

@@ -210,7 +210,7 @@ for which OCCT is certified to work.
| OS | Compiler |
| --------- | ----------- |
| Windows | Microsoft Visual Studio: 2008 SP1, 2010 SP1, 2012 Update 4, 2013 Update 5, 2015 Update 3, 2017 <sup>1</sup>, 2019 <br> GCC 4.3+ (Mingw-w64)|
| Windows | Microsoft Visual Studio: 2008 SP1, 2010 SP1, 2012 Update 4, 2013 Update 5, 2015 Update 3, 2017 <sup>1</sup>, 2019 <br>, LLVM (ClangCL), GCC 4.3+ (Mingw-w64)|
| Linux | GNU gcc 4.3+ <br> LLVM CLang 3.6+ |
| OS X / macOS | XCode 6 or newer |
| Android | NDK r10, GNU gcc 4.8 or newer |

View File

@@ -406,6 +406,47 @@ if(!Interface_Static::SetIVal(;read.step.shape.aspect;,1))
~~~~~
Default value is 1 (ON).
<h4>read.step.constructivegeom.relationship:</h4>
Boolean flag regulating translation of "CONSTRUCTIVE_GEOMETRY_REPRESENTATION_RELATIONSHIP" entities that define
position of constructive geometry entities contained in "CONSTRUCTIVE_GEOMETRY_REPRESENTATION" with respect to the
main representation of the shape (product).
By default, the flag is set to 0 (OFF) so these entities are not translated.
Set this flag to 1 (ON) if you need to translate constructive geometry entities associated with the parts:
~~~~~
if (!Interface_Static::SetIVal("read.step.constructivegeom.relationship", 1)) { .. error .. }
~~~~~
The "CONSTRUCTIVE_GEOMETRY_REPRESENTATION" entity is translated into compound of two unlimited planar faces,
whose location is result of translation of corresponding "AXIS_PLACEMENT" entity.
Note that appropriate interpretation of the translated data should be done after translation.
The result of translation can be obtained either for the "CONSTRUCTIVE_GEOMETRY_REPRESENTATION_RELATIONSHIP" entity,
of for each of the two "AXIS2_PLACEMENT_3D" entities referenced by it. as follows:
~~~~~
STEPControl_Reader aReader;
... // translate file and parse STEP model to find relevant axis entity
Handle(StepGeom_Axis2Placement3d) aSTEPAxis = ...;
Handle(Transfer_Binder) aBinder = aReader->WS()->TransferReader()->TransientProcess()->Find(aSTEPAxis);
Handle(TransferBRep_ShapeBinder) aShBinder = Handle(TransferBRep_ShapeBinder)::DownCast(aBinder);
if (! aShBinder.IsNull())
{
TopoDS_Face aFace = TopoDS::Face (aShBinder->Result());
if (! aFace.IsNull())
{
Handle(Geom_Plane) aSurf = Handle(Geom_Plane)::DownCast (BRep_Tool::Surface (aFace));
if (! aSurf.IsNull())
{
gp_Ax3 anAxis = aSurf->Placement();
... // use the axis placement data
}
}
}
~~~~~
@subsubsection occt_step_2_3_4 Performing the STEP file translation
Perform the translation according to what you want to translate. You can choose either root entities (all or selected by the number of root), or select any entity by its number in the STEP file. There is a limited set of types of entities that can be used as starting entities for translation. Only the following entities are recognized as transferable:

View File

@@ -0,0 +1,27 @@
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="188" height="90" fill="white"/>
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#3D3ACF"/>
<path d="M152 8H134V26H142V16H152V8Z" fill="#3D3ACF"/>
<path d="M152 36H134V54H142V44H152V36Z" fill="#DDDDDD"/>
<path d="M152 64H134V82H142V72H152V64Z" fill="#DDDDDD"/>
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#3D3ACF"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,27 @@
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="188" height="90" fill="white"/>
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#3D3ACF"/>
<path d="M152 8H134V26H142V16H152V8Z" fill="#3D3ACF"/>
<path d="M152 36H134V54H142V44H152V36Z" fill="#3D3ACF"/>
<path d="M152 64H134V82H142V72H152V64Z" fill="#3D3ACF"/>
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#3D3ACF"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,27 @@
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="188" height="90" fill="white"/>
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#DDDDDD"/>
<path d="M152 8H134V26H142V16H152V8Z" fill="#DDDDDD"/>
<path d="M152 36H134V54H142V44H152V36Z" fill="#DDDDDD"/>
<path d="M152 64H134V82H142V72H152V64Z" fill="#DDDDDD"/>
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#DDDDDD"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,27 @@
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="188" height="90" fill="white"/>
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#3D3ACF"/>
<path d="M152 8H134V26H142V16H152V8Z" fill="#DDDDDD"/>
<path d="M152 36H134V54H142V44H152V36Z" fill="#DDDDDD"/>
<path d="M152 64H134V82H142V72H152V64Z" fill="#DDDDDD"/>
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#3D3ACF"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,27 @@
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="188" height="90" fill="white"/>
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#DDDDDD"/>
<path d="M152 8H134V26H142V16H152V8Z" fill="#3D3ACF"/>
<path d="M152 36H134V54H142V44H152V36Z" fill="#3D3ACF"/>
<path d="M152 64H134V82H142V72H152V64Z" fill="#3D3ACF"/>
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#DDDDDD"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,27 @@
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="188" height="90" fill="white"/>
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#DDDDDD"/>
<path d="M152 8H134V26H142V16H152V8Z" fill="#3D3ACF"/>
<path d="M152 36H134V54H142V44H152V36Z" fill="#DDDDDD"/>
<path d="M152 64H134V82H142V72H152V64Z" fill="#3D3ACF"/>
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#DDDDDD"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -830,10 +830,8 @@ myContext->MoveTo (thePixelX, thePixelY, myView, true);
Dynamic detection and selection are put into effect in a straightforward way. There are only a few conventions and functions to be familiar with:
* *AIS_InteractiveContext::MoveTo* -- passes mouse position to Interactive Context selectors.
* *AIS_InteractiveContext::Select* -- stores what has been detected at the last *MoveTo*. Replaces the previously selected object. Empties the stack if nothing has been detected at the last move.
* *AIS_InteractiveContext::ShiftSelect* -- if the object detected at the last move was not already selected, it is added to the list of the selected objects. If not, it is withdrawn. Nothing happens if you click on an empty area.
* *AIS_InteractiveContext::Select* -- selects everything found in the surrounding area.
* *AIS_InteractiveContext::ShiftSelect* -- selects what was not previously in the list of selected, deselects those already present.
* *AIS_InteractiveContext::SelectDetected* -- stores what has been detected at the last *MoveTo*. Changes the previously selected object. Depending on the selection scheme, the selection is enriched, replaced or other.
* *AIS_InteractiveContext::SelectPoint/SelectRectangle/SelectPolygon* -- Applies selection to point, rectangular or surrounding area. Changes the previously selected object. Depending on the selection scheme, the selection is enriched, replaced or other.
Highlighting of detected and selected entities is automatically managed by the Interactive Context. The Highlight colors are those dealt with above. You can nonetheless disconnect this automatic mode if you want to manage this part yourself:
~~~~~
@@ -870,6 +868,17 @@ for (myAISCtx->InitSelected(); myAISCtx->MoreSelected(); myAISCtx->NextSelected(
}
~~~~~
@subsubsection occt_visu_3_4_7 Selection schemes
Select* methods of AIS_InteractiveContext accept some selection scheme as parameter. The table below describes available selection schemes.
| Type | Reaction on click | | Type | Reaction on click |
| :----- | :----- | :----- | :----- | :----- |
| AIS_SelectionScheme_Replace | @figure{visualization_selection_scheme_replace.svg, ""} | | AIS_SelectionScheme_XOR | @figure{visualization_selection_scheme_XOR.svg, ""} |
| AIS_SelectionScheme_Add | @figure{visualization_selection_scheme_add.svg, ""} | | AIS_SelectionScheme_Clear | @figure{visualization_selection_scheme_clear.svg, ""} |
| AIS_SelectionScheme_Remove | @figure{visualization_selection_scheme_remove.svg, ""} | | AIS_SelectionScheme_ReplaceExtra | @figure{visualization_selection_scheme_replaceExtra.svg, ""} |
@subsection occt_visu_3_5 Standard Interactive Object Classes
Interactive Objects are selectable and viewable objects connecting graphic representation and the underlying reference geometry.
@@ -962,26 +971,26 @@ This command can also draw a sphere surface or a volume with a large amount of p
The **Relation** is made up of constraints on one or more interactive shapes and the corresponding reference geometry. For example, you might want to constrain two edges in a parallel relation. This constraint is considered as an object in its own right, and is shown as a sensitive primitive. This takes the graphic form of a perpendicular arrow marked with the || symbol and lying between the two edges.
The following relations are provided by *AIS*:
* *AIS_ConcentricRelation*
* *AIS_FixRelation*
* *AIS_IdenticRelation*
* *AIS_ParallelRelation*
* *AIS_PerpendicularRelation*
* *AIS_Relation*
* *AIS_SymmetricRelation*
* *AIS_TangentRelation*
The following relations are provided by *PrsDim*:
* *PrsDim_ConcentricRelation*
* *PrsDim_FixRelation*
* *PrsDim_IdenticRelation*
* *PrsDim_ParallelRelation*
* *PrsDim_PerpendicularRelation*
* *PrsDim_Relation*
* *PrsDim_SymmetricRelation*
* *PrsDim_TangentRelation*
The list of relations is not exhaustive.
@subsubsection occt_visu_3_5_4 Dimensions
* *AIS_AngleDimension*
* *AIS_Chamf3dDimension*
* *AIS_DiameterDimension*
* *AIS_DimensionOwner*
* *AIS_LengthDimension*
* *AIS_OffsetDimension*
* *AIS_RadiusDimension*
* *PrsDim_AngleDimension*
* *PrsDim_Chamf3dDimension*
* *PrsDim_DiameterDimension*
* *PrsDim_DimensionOwner*
* *PrsDim_LengthDimension*
* *PrsDim_OffsetDimension*
* *PrsDim_RadiusDimension*
@subsubsection occt_visu_3_5_5 MeshVS_Mesh
@@ -1410,7 +1419,7 @@ aView->Update();
@subsubsection occt_visu_4_4_5 Perspective Projection
**Field of view (FOVy)** -- defines the field of camera view by y axis in degrees (45<EFBFBD> is default).
**Field of view (FOVy)** -- defines the field of camera view by y axis in degrees (45° is default).
@figure{camera_perspective.png,"Perspective frustum",420}
@@ -1432,7 +1441,7 @@ There are two types of IOD:
* _Graphic3d_Camera::IODType_Absolute_ : Intraocular distance is defined as an absolute value.
* _Graphic3d_Camera::IODType_Relative_ : Intraocular distance is defined relative to the camera focal length (as its coefficient).
**Field of view (FOV)** -- defines the field of camera view by y axis in degrees (45<EFBFBD> is default).
**Field of view (FOV)** -- defines the field of camera view by y axis in degrees (45° is default).
**ZFocus** -- defines the distance to the point of stereographic focus.

View File

@@ -245,7 +245,10 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->Select (theX1, theY1, theX2, theY2, myView(), Standard_True);
myAISContext()->SelectRectangle (Graphic3d_Vec2i (theX1, theY1),
Graphic3d_Vec2i (theX2, theY2),
myView());
myAISContext()->UpdateCurrentViewer();
}
}
@@ -256,7 +259,8 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->Select (Standard_True);
myAISContext()->SelectDetected();
myAISContext()->UpdateCurrentViewer();
}
}
@@ -278,7 +282,11 @@ public:
{
if ((!myAISContext().IsNull()) && (!myView().IsNull()))
{
myAISContext()->ShiftSelect (theX1, theY1, theX2, theY2, myView(), Standard_True);
myAISContext()->SelectRectangle (Graphic3d_Vec2i (theX1, theY1),
Graphic3d_Vec2i (theX2, theY2),
myView(),
AIS_SelectionScheme_XOR);
myAISContext()->UpdateCurrentViewer();
}
}
@@ -289,7 +297,8 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->ShiftSelect (Standard_True);
myAISContext()->SelectDetected (AIS_SelectionScheme_XOR);
myAISContext()->UpdateCurrentViewer();
}
}

View File

@@ -262,7 +262,10 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->Select (theX1, theY1, theX2, theY2, myView(), Standard_True);
myAISContext()->SelectRectangle (Graphic3d_Vec2i (theX1, theY1),
Graphic3d_Vec2i (theX2, theY2),
myView());
myAISContext()->UpdateCurrentViewer();
}
}
@@ -273,7 +276,8 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->Select (Standard_True);
myAISContext()->SelectDetected();
myAISContext()->UpdateCurrentViewer();
}
}
@@ -295,7 +299,11 @@ public:
{
if (!myAISContext().IsNull() && !myView().IsNull())
{
myAISContext()->ShiftSelect (theX1, theY1, theX2, theY2, myView(), Standard_True);
myAISContext()->SelectRectangle (Graphic3d_Vec2i (theX1, theY1),
Graphic3d_Vec2i (theX2, theY2),
myView(),
AIS_SelectionScheme_XOR);
myAISContext()->UpdateCurrentViewer();
}
}
@@ -306,7 +314,8 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->ShiftSelect (Standard_True);
myAISContext()->SelectDetected (AIS_SelectionScheme_XOR);
myAISContext()->UpdateCurrentViewer();
}
}

View File

@@ -24,7 +24,7 @@
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <OpenGl_GraphicDriver.hxx>
#include <Prs3d.hxx>
#include <StdPrs_ToolTriangulatedShape.hxx>
#include <Prs3d_Drawer.hxx>
#include <STEPControl_Reader.hxx>
#include <STEPCAFControl_Reader.hxx>
@@ -257,12 +257,12 @@ bool OcctViewer::ImportSTEP(std::string theFilename)
}
Handle(Prs3d_Drawer) aDrawer = myContext->DefaultDrawer();
Standard_Real aDeflection = Prs3d::GetDeflection (aCompound, aDrawer);
Standard_Real aDeflection = StdPrs_ToolTriangulatedShape::GetDeflection (aCompound, aDrawer);
if (!BRepTools::Triangulation (aCompound, aDeflection))
{
BRepMesh_IncrementalMesh anAlgo;
anAlgo.ChangeParameters().Deflection = aDeflection;
anAlgo.ChangeParameters().Angle = aDrawer->HLRAngle();
anAlgo.ChangeParameters().Angle = aDrawer->DeviationAngle();
anAlgo.ChangeParameters().InParallel = Standard_True;
anAlgo.SetShape (aCompound);
anAlgo.Perform();

View File

@@ -48,27 +48,11 @@ OcctJni_MsgPrinter::~OcctJni_MsgPrinter()
}
// =======================================================================
// function : Send
// function : send
// purpose :
// =======================================================================
void OcctJni_MsgPrinter::Send (const TCollection_ExtendedString& theString,
const Message_Gravity theGravity,
const Standard_Boolean theToPutEndl) const
{
if (theGravity >= myTraceLevel)
{
const TCollection_AsciiString aStr (theString);
OcctJni_MsgPrinter::Send (aStr, theGravity, theToPutEndl);
}
}
// =======================================================================
// function : Send
// purpose :
// =======================================================================
void OcctJni_MsgPrinter::Send (const TCollection_AsciiString& theString,
const Message_Gravity theGravity,
const Standard_Boolean theToPutEndl) const
void OcctJni_MsgPrinter::send (const TCollection_AsciiString& theString,
const Message_Gravity theGravity) const
{
if (theGravity < myTraceLevel)
{
@@ -85,17 +69,3 @@ void OcctJni_MsgPrinter::Send (const TCollection_AsciiString& theString,
myJEnv->CallObjectMethod (myJObj, myJMet, aJStr);
myJEnv->DeleteLocalRef (aJStr);
}
// =======================================================================
// function : Send
// purpose :
// =======================================================================
void OcctJni_MsgPrinter::Send (const Standard_CString& theString,
const Message_Gravity theGravity,
const Standard_Boolean theToPutEndl) const
{
if (theGravity >= myTraceLevel)
{
OcctJni_MsgPrinter::Send (TCollection_AsciiString (theString), theGravity, theToPutEndl);
}
}

View File

@@ -30,20 +30,11 @@ public:
//! Destructor.
~OcctJni_MsgPrinter();
//! Redirection to TCollection_AsciiString method
virtual void Send (const TCollection_ExtendedString& theString,
const Message_Gravity theGravity,
const Standard_Boolean theToPutEndl) const;
//! Redirection to TCollection_AsciiString method
virtual void Send (const Standard_CString& theString,
const Message_Gravity theGravity,
const Standard_Boolean theToPutEndl) const;
protected:
//! Main printing method
virtual void Send (const TCollection_AsciiString& theString,
const Message_Gravity theGravity,
const Standard_Boolean theToPutEndl) const;
virtual void send (const TCollection_AsciiString& theString,
const Message_Gravity theGravity) const;
private:

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

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