1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Compare commits

..

6 Commits

Author SHA1 Message Date
emv
6542788b04 # fixing errors on linux and MacOS 2020-05-21 10:05:05 +03:00
emv
b062dc431d # Added debug commands to draw Bnd_Box and Bnd_OBB
# Reverted points addition into Box of the grid cell.
2020-05-21 08:51:22 +03:00
emv
29376f7703 # avoid multiple queries from array. 2020-05-19 11:36:38 +03:00
emv
448ecf7bd5 # build hierarchy of BVH trees 2020-05-18 23:27:31 +03:00
emv
9cc449ed6a # Decrease the box of the sample to make BVH tree more effective.
# When looking for MINMAX solutions search first for Min solutions first and then for Max.
2020-05-18 23:27:26 +03:00
emv
c6991f13e7 0030892: Improve Extrema_ExtPS algorithm by unifying the GRAD and TREE methods
Refactoring of the Extrema_GenExtPS class in order to improve performance and robustness of the algorithm by unifying the GRAD and TREE search methods.
2020-05-18 23:27:23 +03:00
468 changed files with 4486 additions and 20109 deletions

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,27 +0,0 @@
<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>

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,27 +0,0 @@
<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>

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,27 +0,0 @@
<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>

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,27 +0,0 @@
<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>

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,27 +0,0 @@
<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>

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,27 +0,0 @@
<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>

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -830,8 +830,10 @@ 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::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.
* *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.
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:
~~~~~
@@ -868,17 +870,6 @@ 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.
@@ -1419,7 +1410,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° is default).
**Field of view (FOVy)** -- defines the field of camera view by y axis in degrees (45<EFBFBD> is default).
@figure{camera_perspective.png,"Perspective frustum",420}
@@ -1441,7 +1432,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° is default).
**Field of view (FOV)** -- defines the field of camera view by y axis in degrees (45<EFBFBD> is default).
**ZFocus** -- defines the distance to the point of stereographic focus.

View File

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

View File

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

View File

@@ -244,8 +244,7 @@ void CGeometryDoc::InputEvent2D(const Standard_Integer /*x*/,
const Standard_Integer /*y*/,
const Handle(V3d_View)& /*aView*/)
{
myAISContext2D->SelectDetected();
myAISContext2D->UpdateCurrentViewer();
myAISContext2D->Select(Standard_True);
}
//-----------------------------------------------------------------------------------------
@@ -353,8 +352,7 @@ void CGeometryDoc::InputEvent (const Standard_Integer /*theMouseX*/,
const Standard_Integer /*theMouseY*/,
const Handle(V3d_View)& /*theView*/)
{
myAISContext->SelectDetected();
myAISContext2D->UpdateCurrentViewer();
myAISContext->Select (Standard_True);
}
//-----------------------------------------------------------------------------------------

View File

@@ -4816,9 +4816,7 @@ void CModelingDoc::InputEvent(const Standard_Integer /*x*/,
const Standard_Integer /*y*/,
const Handle(V3d_View)& /*aView*/)
{
myAISContext->SelectDetected();
myAISContext->UpdateCurrentViewer();
myAISContext->Select (Standard_True);
if (myState == SELECT_EDGE_PLATE_TGTES_1) {
myAISContext->InitSelected();
if (myAISContext->MoreSelected()) {

View File

@@ -506,7 +506,7 @@ void CViewer3dDoc::InputEvent(const Standard_Integer /*x*/,
Quantity_Color CSFColor;
COLORREF MSColor;
myAISContext->SelectDetected();
myAISContext->Select (Standard_True);
// Change the color of a selected face in a user cylinder
if (myState == FACE_COLOR)

View File

@@ -328,9 +328,7 @@ void CHLRView3D::DragEvent(const Standard_Integer x ,
}
if (TheState == 0)
GetDocument()->GetAISContext()->SelectRectangle(Graphic3d_Vec2i (theButtonDownX,theButtonDownY),
Graphic3d_Vec2i (x,y),
myView);
GetDocument()->GetAISContext()->Select(theButtonDownX,theButtonDownY,x,y,myView);
}
//-----------------------------------------------------------------------------------------
@@ -339,7 +337,7 @@ void CHLRView3D::DragEvent(const Standard_Integer x ,
void CHLRView3D::InputEvent(const Standard_Integer x ,
const Standard_Integer y )
{
GetDocument()->GetAISContext()->SelectDetected();
GetDocument()->GetAISContext()->Select();
}
//-----------------------------------------------------------------------------------------
@@ -377,10 +375,7 @@ void CHLRView3D::MultiDragEvent(const Standard_Integer x ,
}
if (TheState == 0)
GetDocument()->GetAISContext()->SelectRectangle(Graphic3d_Vec2i (theButtonDownX,theButtonDownY),
Graphic3d_Vec2i (x,y),
myView,
AIS_SelectionScheme_XOR);
GetDocument()->GetAISContext()->ShiftSelect(theButtonDownX,theButtonDownY,x,y,myView);
}
@@ -390,6 +385,6 @@ void CHLRView3D::MultiDragEvent(const Standard_Integer x ,
void CHLRView3D::MultiInputEvent(const Standard_Integer x ,
const Standard_Integer y )
{
GetDocument()->GetAISContext()->SelectDetected(AIS_SelectionScheme_XOR);
GetDocument()->GetAISContext()->ShiftSelect();
}

View File

@@ -111,10 +111,9 @@ void OCC_3dBaseDoc::DragEvent (const Standard_Integer theMouseX,
}
case 1:
{
myAISContext->SelectRectangle (Graphic3d_Vec2i (aStartDragX, aStartDragY),
Graphic3d_Vec2i (theMouseX, theMouseY),
theView);
myAISContext->UpdateCurrentViewer();
myAISContext->Select (aStartDragX, aStartDragY,
theMouseX, theMouseY,
theView, Standard_True);
break;
}
};
@@ -128,8 +127,7 @@ void OCC_3dBaseDoc::InputEvent (const Standard_Integer theMouseX,
const Handle(V3d_View)& theView)
{
myAISContext->MoveTo (theMouseX, theMouseY, theView, Standard_False);
myAISContext->SelectDetected();
myAISContext->UpdateCurrentViewer();
myAISContext->Select (Standard_True);
}
//-----------------------------------------------------------------------------------------
@@ -177,10 +175,9 @@ void OCC_3dBaseDoc::ShiftDragEvent (const Standard_Integer theMouseX,
if (theState == 0)
{
// button up
myAISContext->SelectRectangle (Graphic3d_Vec2i (aStartDragX, aStartDragY),
Graphic3d_Vec2i (theMouseX, theMouseY),
theView, AIS_SelectionScheme_XOR);
myAISContext->UpdateCurrentViewer();
myAISContext->ShiftSelect (aStartDragX, aStartDragY,
theMouseX, theMouseY,
theView, Standard_True);
}
}
@@ -191,8 +188,7 @@ void OCC_3dBaseDoc::ShiftInputEvent (const Standard_Integer /*theMouseX*/,
const Standard_Integer /*theMouseY*/,
const Handle(V3d_View)& /*theView*/)
{
myAISContext->SelectDetected (AIS_SelectionScheme_XOR);
myAISContext->UpdateCurrentViewer();
myAISContext->ShiftSelect (Standard_True);
}
//-----------------------------------------------------------------------------------------

View File

@@ -637,11 +637,6 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
{
aShadedGroup = thePrs->NewGroup();
aShadedGroup->SetClosed (isClosed);
if (isClosed)
{
if (aDrawer->HasOwnFillCappingAspect())
aShadedGroup->SetGroupPrimitivesAspect (aDrawer->FillCappingAspect());
}
}
aShadedGroup->SetPrimitivesAspect (aDrawer->ShadingAspect()->Aspect());
aShadedGroup->AddPrimitiveArray (aTriangles);

View File

@@ -39,8 +39,6 @@
#include <Prs3d_ShadingAspect.hxx>
#include <PrsMgr_PresentableObject.hxx>
#include <Quantity_Color.hxx>
#include <SelectMgr_AndFilter.hxx>
#include <SelectMgr_DisabledObjectsFilter.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_OrFilter.hxx>
@@ -130,7 +128,7 @@ myMainVwr(MainViewer),
myMainSel(new StdSelect_ViewerSelector3d()),
myToHilightSelected(Standard_True),
mySelection(new AIS_Selection()),
myFilters(new SelectMgr_AndFilter()),
myFilters(new SelectMgr_OrFilter()),
myDefaultDrawer(new Prs3d_Drawer()),
myCurDetected(0),
myCurHighlighted(0),
@@ -138,8 +136,6 @@ myPickingStrategy (SelectMgr_PickingStrategy_FirstAcceptable),
myAutoHilight(Standard_True),
myIsAutoActivateSelMode(Standard_True)
{
myFilters->Add (new SelectMgr_DisabledObjectsFilter());
mgrSelector = new SelectMgr_SelectionManager (myMainSel);
myStyles[Prs3d_TypeOfHighlight_None] = myDefaultDrawer;
@@ -2409,15 +2405,6 @@ void AIS_InteractiveContext::SetTransformPersistence (const Handle(AIS_Interacti
const Handle(Graphic3d_TransformPers)& theTrsfPers)
{
theObject->SetTransformPersistence (theTrsfPers);
UpdateOnTransformPersistence (theObject);
}
//=======================================================================
//function : UpdateOnTransformPersistence
//purpose :
//=======================================================================
void AIS_InteractiveContext::UpdateOnTransformPersistence (const Handle(AIS_InteractiveObject)& theObject)
{
if (!myObjects.IsBound (theObject))
{
return;

View File

@@ -25,12 +25,10 @@
#include <AIS_ListOfInteractive.hxx>
#include <AIS_Selection.hxx>
#include <AIS_SelectionModesConcurrency.hxx>
#include <AIS_SelectionScheme.hxx>
#include <AIS_StatusOfDetection.hxx>
#include <AIS_StatusOfPick.hxx>
#include <AIS_TypeOfIso.hxx>
#include <Aspect_TypeOfFacingModel.hxx>
#include <Graphic3d_Vec2.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_TypeOfHighlight.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
@@ -48,7 +46,7 @@
class SelectMgr_SelectionManager;
class V3d_Viewer;
class SelectMgr_AndFilter;
class SelectMgr_OrFilter;
class V3d_View;
class TopLoc_Location;
class TCollection_ExtendedString;
@@ -346,11 +344,6 @@ public: //! @name object local transformation management
Standard_EXPORT void SetTransformPersistence (const Handle(AIS_InteractiveObject)& theObject,
const Handle(Graphic3d_TransformPers)& theTrsfPers);
//! Updates displayed interactive object by checking and recomputing its flagged as "to be recomputed" presentation and selection structures.
//! This method does not force any recomputation on its own.
//! The method recomputes selections even if they are loaded without activation in particular selector.
Standard_EXPORT void UpdateOnTransformPersistence (const Handle(AIS_InteractiveObject)& theIObj);
Standard_DEPRECATED("This method is deprecated - SetTransformPersistence() taking Graphic3d_TransformPers should be called instead")
void SetTransformPersistence (const Handle(AIS_InteractiveObject)& theObj,
const Graphic3d_TransModeFlags& theFlag,
@@ -477,49 +470,8 @@ public: //! @name Selection management
return AddSelect (theObject->GlobalSelOwner());
}
//! Selects objects within the bounding rectangle.
//! Viewer should be explicitly redrawn after selection.
//! @param thePntMin [in] rectangle lower point (in pixels)
//! @param thePntMax [in] rectangle upper point (in pixels)
//! @param theView [in] active view where rectangle is defined
//! @param theSelScheme [in] selection scheme
//! @return picking status
//! @sa StdSelect_ViewerSelector3d::AllowOverlapDetection()
Standard_EXPORT AIS_StatusOfPick SelectRectangle (const Graphic3d_Vec2i& thePntMin,
const Graphic3d_Vec2i& thePntMax,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
//! Select everything found in the polygon defined by bounding polyline.
//! Viewer should be explicitly redrawn after selection.
//! @param thePolyline [in] polyline defining polygon bounds (in pixels)
//! @param theView [in] active view where polyline is defined
//! @param theSelScheme [in] selection scheme
//! @return picking status
Standard_EXPORT AIS_StatusOfPick SelectPolygon (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
//! Selects the topmost object picked by the point in the view,
//! Viewer should be explicitly redrawn after selection.
//! @param thePnt [in] point pixel coordinates within the view
//! @param theView [in] active view where point is defined
//! @param theSelScheme [in] selection scheme
//! @return picking status
Standard_EXPORT AIS_StatusOfPick SelectPoint (const Graphic3d_Vec2i& thePnt,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
//! Select and hilights the previous detected via AIS_InteractiveContext::MoveTo() method;
//! unhilights the previous picked.
//! Viewer should be explicitly redrawn after selection.
//! @param theSelScheme [in] selection scheme
//! @return picking status
Standard_EXPORT AIS_StatusOfPick SelectDetected (const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
//! Selects everything found in the bounding rectangle defined by the pixel minima and maxima, XPMin, YPMin, XPMax, and YPMax in the view.
//! The objects detected are passed to the main viewer, which is then updated.
Standard_DEPRECATED("This method is deprecated - SelectRectangle() taking AIS_SelectionScheme_Replace should be called instead")
Standard_EXPORT AIS_StatusOfPick Select (const Standard_Integer theXPMin,
const Standard_Integer theYPMin,
const Standard_Integer theXPMax,
@@ -528,32 +480,27 @@ public: //! @name Selection management
const Standard_Boolean theToUpdateViewer);
//! polyline selection; clears the previous picked list
Standard_DEPRECATED("This method is deprecated - SelectPolygon() taking AIS_SelectionScheme_Replace should be called instead")
Standard_EXPORT AIS_StatusOfPick Select (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const Standard_Boolean theToUpdateViewer);
//! Stores and hilights the previous detected; Unhilights the previous picked.
//! @sa MoveTo().
Standard_DEPRECATED("This method is deprecated - SelectDetected() taking AIS_SelectionScheme_Replace should be called instead")
Standard_EXPORT AIS_StatusOfPick Select (const Standard_Boolean theToUpdateViewer);
//! Adds the last detected to the list of previous picked.
//! If the last detected was already declared as picked, removes it from the Picked List.
//! @sa MoveTo().
Standard_DEPRECATED("This method is deprecated - SelectDetected() taking AIS_SelectionScheme_XOR should be called instead")
Standard_EXPORT AIS_StatusOfPick ShiftSelect (const Standard_Boolean theToUpdateViewer);
//! Adds the last detected to the list of previous picked.
//! If the last detected was already declared as picked, removes it from the Picked List.
Standard_DEPRECATED("This method is deprecated - SelectPolygon() taking AIS_SelectionScheme_XOR should be called instead")
Standard_EXPORT AIS_StatusOfPick ShiftSelect (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const Standard_Boolean theToUpdateViewer);
//! Rectangle of selection; adds new detected entities into the picked list,
//! removes the detected entities that were already stored.
Standard_DEPRECATED("This method is deprecated - SelectRectangle() taking AIS_SelectionScheme_XOR should be called instead")
Standard_EXPORT AIS_StatusOfPick ShiftSelect (const Standard_Integer theXPMin,
const Standard_Integer theYPMin,
const Standard_Integer theXPMax,
@@ -564,13 +511,6 @@ public: //! @name Selection management
//! Returns bounding box of selected objects.
Standard_EXPORT Bnd_Box BoundingBoxOfSelection() const;
//! Sets list of owner selected/deselected using specified selection scheme.
//! @param theOwners owners to change selection state
//! @param theSelScheme selection scheme
//! @return picking status
Standard_EXPORT AIS_StatusOfPick Select (const AIS_NArray1OfEntityOwner& theOwners,
const AIS_SelectionScheme theSelScheme);
//! Fits the view correspondingly to the bounds of selected objects.
//! Infinite objects are ignored if infinite state of AIS_InteractiveObject is set to true.
Standard_EXPORT void FitSelected (const Handle(V3d_View)& theView,
@@ -796,20 +736,13 @@ public: //! @name management of active Selection Modes
public: //! @name Selection Filters management
//! Allows you to set the filter.
Standard_EXPORT void SetFilter (const Handle(SelectMgr_Filter)& theFilter);
//! Returns the filter. Use with global is in false to get the filter, that is set with SetFilter.
//! If global filter is true, it returns whole filter used in the context (with an internal default filter)
Standard_EXPORT Handle(SelectMgr_Filter) Filter (const Standard_Boolean isGlobalFilter = Standard_False) const;
//! Returns the list of filters active in a local context.
Standard_EXPORT SelectMgr_ListOfFilter Filters() const;
Standard_EXPORT const SelectMgr_ListOfFilter& Filters() const;
//! Allows you to add the filter. Default filter here is Or filter.
//! Allows you to add the filter.
Standard_EXPORT void AddFilter (const Handle(SelectMgr_Filter)& theFilter);
//! Removes a filter from context. Default filter here is Or filter
//! Removes a filter from context.
Standard_EXPORT void RemoveFilter (const Handle(SelectMgr_Filter)& theFilter);
//! Remove all filters from context.
@@ -1428,7 +1361,7 @@ protected: //! @name internal fields
Handle(SelectMgr_EntityOwner) myLastPicked;
Standard_Boolean myToHilightSelected;
Handle(AIS_Selection) mySelection;
Handle(SelectMgr_AndFilter) myFilters;
Handle(SelectMgr_OrFilter) myFilters;
Handle(Prs3d_Drawer) myDefaultDrawer;
Handle(Prs3d_Drawer) myStyles[Prs3d_TypeOfHighlight_NB];
TColStd_SequenceOfInteger myDetectedSeq;

View File

@@ -31,11 +31,8 @@
#include <Prs3d_Presentation.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <SelectMgr_AndFilter.hxx>
#include <SelectMgr_DisabledObjectsFilter.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_FilterReaction.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_Selection.hxx>
#include <SelectMgr_SelectionManager.hxx>
@@ -126,12 +123,7 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
return;
}
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (theObj);
if (!aStatusPtr)
{
return;
}
const Standard_Integer aHiMode = getHilightMode (theObj, theStyle, (*aStatusPtr)->DisplayMode());
const Standard_Integer aHiMode = getHilightMode (theObj, theStyle, theDispMode);
const Handle(SelectMgr_EntityOwner)& aGlobOwner = theObj->GlobalSelOwner();
if (aGlobOwner.IsNull())
@@ -180,16 +172,20 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
{
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
const Handle(AIS_InteractiveObject) anInteractive = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anInteractive);
Handle(AIS_GlobalStatus) aStatus;
if (!myObjects.Find (anInteractive, aStatus))
{
continue;
}
if (anOwner->IsAutoHilight())
{
anOwner->Unhilight (myMainPM);
if (theIsToHilightSubIntensity)
{
if (aStatusPtr && (*aStatusPtr)->IsSubIntensityOn())
if (aStatus->IsSubIntensityOn())
{
const Standard_Integer aHiMode = getHilightMode (anInteractive, (*aStatusPtr)->HilightStyle(), (*aStatusPtr)->DisplayMode());
const Standard_Integer aHiMode = getHilightMode (anInteractive, aStatus->HilightStyle(), aStatus->DisplayMode());
highlightWithSubintensity (anOwner, aHiMode);
}
}
@@ -198,11 +194,10 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
{
anObjToClear.Add (anInteractive);
}
if (aStatusPtr && anOwner == anInteractive->GlobalSelOwner())
if (anOwner == anInteractive->GlobalSelOwner())
{
(*aStatusPtr)->SetHilightStatus (Standard_False);
aStatus->SetHilightStatus (Standard_False);
}
(*aStatusPtr)->SetHilightStyle (Handle(Prs3d_Drawer)());
}
for (NCollection_IndexedMap<Handle(AIS_InteractiveObject)>::Iterator anIter (anObjToClear); anIter.More(); anIter.Next())
{
@@ -340,8 +335,7 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer th
AIS_StatusOfDetection aStatus = AIS_SOD_Nothing;
Standard_Boolean toUpdateViewer = Standard_False;
Handle(SelectMgr_DisabledObjectsFilter) anObjectsFilter = Handle(SelectMgr_DisabledObjectsFilter)::DownCast (myFilters->StoredFilters().First());
anObjectsFilter->SetDisabledObjects (theView->View()->HiddenObjects());
myFilters->SetDisabledObjects (theView->View()->HiddenObjects());
myMainSel->Pick (theXPix, theYPix, theView);
// filling of myAISDetectedSeq sequence storing information about detected AIS objects
@@ -353,7 +347,7 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer th
{
Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aDetIter);
if (anOwner.IsNull()
|| !myFilters->IsOk (anOwner, SelectMgr_FilterReaction_Highlight))
|| !myFilters->IsOk (anOwner))
{
if (myPickingStrategy == SelectMgr_PickingStrategy_OnlyTopmost)
{
@@ -488,100 +482,95 @@ AIS_StatusOfPick AIS_InteractiveContext::AddSelect (const Handle(SelectMgr_Entit
}
//=======================================================================
//function : SelectRectangle
//purpose :
//function : Select
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::SelectRectangle (const Graphic3d_Vec2i& thePntMin,
const Graphic3d_Vec2i& thePntMax,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme)
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Integer theXPMin,
const Standard_Integer theYPMin,
const Standard_Integer theXPMax,
const Standard_Integer theYPMax,
const Handle(V3d_View)& theView,
const Standard_Boolean toUpdateViewer)
{
if (theView->Viewer() != myMainVwr)
{
throw Standard_ProgramError ("AIS_InteractiveContext::SelectRectangle() - invalid argument");
throw Standard_ProgramError ("AIS_InteractiveContext::Select() - invalid argument");
}
// all objects detected by the selector are taken, previous current objects are emptied,
// new objects are put...
ClearSelected (Standard_False);
myLastActiveView = theView.get();
myMainSel->Pick (thePntMin.x(), thePntMin.y(), thePntMax.x(), thePntMax.y(), theView);
AIS_NArray1OfEntityOwner aPickedOwners;
if (myMainSel->NbPicked() > 0)
myMainSel->Pick (theXPMin, theYPMin, theXPMax, theYPMax, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
aPickedOwners.Resize (1, myMainSel->NbPicked(), Standard_False);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
aPickedOwners.ChangeValue (aPickIter) = myMainSel->Picked (aPickIter);
}
const Handle(SelectMgr_EntityOwner)& aCurOwner = myMainSel->Picked (aPickIter);
if (aCurOwner.IsNull() || !aCurOwner->HasSelectable() || !myFilters->IsOk (aCurOwner))
continue;
mySelection->Select (aCurOwner);
}
return Select (aPickedOwners, theSelScheme);
if (myAutoHilight)
{
HilightSelected (toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
}
//=======================================================================
//function : SelectPolygon
//purpose :
//function : Select
//purpose : Selection by polyline
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::SelectPolygon (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme)
AIS_StatusOfPick AIS_InteractiveContext::Select (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const Standard_Boolean toUpdateViewer)
{
if (theView->Viewer() != myMainVwr)
{
throw Standard_ProgramError ("AIS_InteractiveContext::SelectPolygon() - invalid argument");
throw Standard_ProgramError ("AIS_InteractiveContext::Select() - invalid argument");
}
// all objects detected by the selector are taken, previous current objects are emptied,
// new objects are put...
ClearSelected (Standard_False);
myLastActiveView = theView.get();
myMainSel->Pick (thePolyline, theView);
AIS_NArray1OfEntityOwner aPickedOwners;
if (myMainSel->NbPicked() > 0)
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
aPickedOwners.Resize (1, myMainSel->NbPicked(), Standard_False);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
aPickedOwners.ChangeValue (aPickIter) = myMainSel->Picked (aPickIter);
}
const Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aPickIter);
if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
continue;
mySelection->Select (anOwner);
}
return Select (aPickedOwners, theSelScheme);
if (myAutoHilight)
{
HilightSelected (toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
}
//=======================================================================
//function : SelectPoint
//purpose :
//function : Select
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::SelectPoint (const Graphic3d_Vec2i& thePnt,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme)
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean toUpdateViewer)
{
if (theView->Viewer() != myMainVwr)
{
throw Standard_ProgramError ("AIS_InteractiveContext::SelectPoint() - invalid argument");
}
myLastActiveView = theView.get();
myMainSel->Pick (thePnt.x(), thePnt.y(), theView);
AIS_NArray1OfEntityOwner aPickedOwners;
if (myMainSel->NbPicked() > 0)
{
aPickedOwners.Resize (1, myMainSel->NbPicked(), Standard_False);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
aPickedOwners.ChangeValue (aPickIter) = myMainSel->Picked (aPickIter);
}
}
return Select (aPickedOwners, theSelScheme);
}
//=======================================================================
//function : SelectDetected
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::SelectDetected (const AIS_SelectionScheme theSelScheme)
{
if (theSelScheme == AIS_SelectionScheme_Replace && !myLastPicked.IsNull())
if (!myLastPicked.IsNull())
{
Graphic3d_Vec2i aMousePos (-1, -1);
if (myMainSel->GetManager().GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Point)
@@ -593,76 +582,54 @@ AIS_StatusOfPick AIS_InteractiveContext::SelectDetected (const AIS_SelectionSche
{
return AIS_SOP_NothingSelected;
}
if (myAutoHilight)
{
clearDynamicHighlight();
}
if (!myLastPicked->IsSelected()
|| myLastPicked->IsForcedHilight()
|| NbSelected() > 1)
{
SetSelected (myLastPicked, Standard_False);
if(toUpdateViewer)
{
UpdateCurrentViewer();
}
}
}
AIS_NArray1OfEntityOwner aPickedOwners(1, 1);
aPickedOwners.ChangeValue (1) = myLastPicked;
return Select (aPickedOwners, theSelScheme);
}
//=======================================================================
//function : Select
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Integer theXPMin,
const Standard_Integer theYPMin,
const Standard_Integer theXPMax,
const Standard_Integer theYPMax,
const Handle(V3d_View)& theView,
const Standard_Boolean theToUpdateViewer)
{
AIS_StatusOfPick aStatus = SelectRectangle (Graphic3d_Vec2i (theXPMin, theYPMin),
Graphic3d_Vec2i (theXPMax, theYPMax),
theView);
if (theToUpdateViewer)
else
{
UpdateCurrentViewer();
ClearSelected (toUpdateViewer);
}
return aStatus;
}
//=======================================================================
//function : Select
//purpose : Selection by polyline
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const Standard_Boolean theToUpdateViewer)
{
AIS_StatusOfPick aStatus = SelectPolygon (thePolyline, theView);
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
return aStatus;
}
Standard_Integer aSelNum = NbSelected();
//=======================================================================
//function : Select
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean theToUpdateViewer)
{
AIS_StatusOfPick aStatus = SelectDetected();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
return aStatus;
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
}
//=======================================================================
//function : ShiftSelect
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Boolean theToUpdateViewer)
AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Boolean toUpdateViewer)
{
AIS_StatusOfPick aStatus = SelectDetected (AIS_SelectionScheme_XOR);
if (theToUpdateViewer)
if (myAutoHilight)
{
UpdateCurrentViewer();
clearDynamicHighlight();
}
return aStatus;
if (!myLastPicked.IsNull())
{
AddOrRemoveSelected (myLastPicked, toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
}
//=======================================================================
@@ -674,17 +641,39 @@ AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Integer the
const Standard_Integer theXPMax,
const Standard_Integer theYPMax,
const Handle(V3d_View)& theView,
const Standard_Boolean theToUpdateViewer)
const Standard_Boolean toUpdateViewer)
{
AIS_StatusOfPick aStatus = SelectRectangle (Graphic3d_Vec2i (theXPMin, theYPMin),
Graphic3d_Vec2i (theXPMax, theYPMax),
theView,
AIS_SelectionScheme_XOR);
if (theToUpdateViewer)
if (theView->Viewer() != myMainVwr)
{
UpdateCurrentViewer();
throw Standard_ProgramError ("AIS_InteractiveContext::ShiftSelect() - invalid argument");
}
return aStatus;
myLastActiveView = theView.get();
if (myAutoHilight)
{
UnhilightSelected (Standard_False);
}
myMainSel->Pick (theXPMin, theYPMin, theXPMax, theYPMax, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
const Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aPickIter);
if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
continue;
mySelection->Select (anOwner);
}
if (myAutoHilight)
{
HilightSelected (toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
}
//=======================================================================
@@ -693,78 +682,31 @@ AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Integer the
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const Standard_Boolean theToUpdateViewer)
const Standard_Boolean toUpdateViewer)
{
AIS_StatusOfPick aStatus = SelectPolygon (thePolyline, theView, AIS_SelectionScheme_XOR);
if (theToUpdateViewer)
if (theView->Viewer() != myMainVwr)
{
UpdateCurrentViewer();
throw Standard_ProgramError ("AIS_InteractiveContext::ShiftSelect() - invalid argument");
}
return aStatus;
}
//=======================================================================
//function : Select
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const AIS_NArray1OfEntityOwner& theOwners,
const AIS_SelectionScheme theSelScheme)
{
NCollection_IndexedMap<Handle(SelectMgr_EntityOwner)> aSelOwnerMap (myAutoHilight ? mySelection->Objects().Size() : 0);
myLastActiveView = theView.get();
if (myAutoHilight)
{
clearDynamicHighlight();
// collect currently selected owners
for (AIS_NListOfEntityOwner::Iterator anOwnerIter (mySelection->Objects()); anOwnerIter.More(); anOwnerIter.Next())
{
aSelOwnerMap.Add (anOwnerIter.Value());
}
UnhilightSelected (Standard_False);
}
myMainSel->Pick (thePolyline, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
const Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aPickIter);
if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
continue;
mySelection->SelectOwners (theOwners, theSelScheme, myFilters);
mySelection->Select (anOwner);
}
if (myAutoHilight)
{
// collect lists of owners to unhighlight (unselected) and to highlight (selected)
AIS_NListOfEntityOwner anOwnersToUnhighlight, anOwnersToHighlight;
for (AIS_NListOfEntityOwner::Iterator anOwnerIter (mySelection->Objects()); anOwnerIter.More(); anOwnerIter.Next())
{
// add newly selected owners
const Handle(SelectMgr_EntityOwner)& anOwner = anOwnerIter.Value();
if (!aSelOwnerMap.RemoveKey (anOwner))
{
// newly selected owner
anOwnersToHighlight.Append (anOwner);
}
else
{
// already selected owner
if (!anOwner->IsAutoHilight()
&& theSelScheme != AIS_SelectionScheme_XOR
&& theSelScheme != AIS_SelectionScheme_Add)
{
// hack to perform AIS_InteractiveObject::ClearSelected() before highlighting
anOwnersToUnhighlight.Append (anOwner);
anOwnersToHighlight.Append (anOwner);
}
else if (anOwner->IsForcedHilight()
|| !anOwner->IsAutoHilight())
{
anOwnersToHighlight.Append (anOwner);
}
}
}
for (NCollection_IndexedMap<Handle(SelectMgr_EntityOwner)>::Iterator anOwnerIter (aSelOwnerMap); anOwnerIter.More(); anOwnerIter.Next())
{
// owners removed from selection
const Handle(SelectMgr_EntityOwner)& anOwner = anOwnerIter.Value();
anOwnersToUnhighlight.Append (anOwner);
}
unhighlightOwners (anOwnersToUnhighlight);
highlightOwners (anOwnersToHighlight);
HilightSelected (toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
@@ -804,13 +746,11 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
continue;
const Handle(Prs3d_Drawer)& anObjSelStyle = getSelStyle (anObj, anOwner);
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
if (!aStatusPtr)
continue;
Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind(anObj);
if (anOwner == anObj->GlobalSelOwner())
{
(*aStatusPtr)->SetHilightStatus (Standard_True);
(*aStatusPtr)->SetHilightStyle (anObjSelStyle);
aState->SetHilightStatus (Standard_True);
aState->SetHilightStyle (anObjSelStyle);
}
if (!anOwner->IsAutoHilight())
{
@@ -828,7 +768,7 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
}
else
{
const Standard_Integer aHiMode = getHilightMode (anObj, anObjSelStyle, (*aStatusPtr)->DisplayMode());
const Standard_Integer aHiMode = getHilightMode (anObj, anObjSelStyle, aState->DisplayMode());
anOwner->HilightWithColor (myMainPM, anObjSelStyle, aHiMode);
}
}
@@ -920,7 +860,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner)& aSelOwner = aSelIter.Value();
if (!myFilters->IsOk (aSelOwner, SelectMgr_FilterReaction_Select))
if (!myFilters->IsOk (aSelOwner))
{
continue;
}
@@ -932,9 +872,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
}
if (aSelOwner == aSelectable->GlobalSelOwner())
{
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (aSelectable);
if (aStatusPtr)
(*aStatusPtr)->SetHilightStatus (Standard_False);
myObjects.ChangeFind (aSelectable)->SetHilightStatus (Standard_False);
}
}
@@ -968,7 +906,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& theOwner,
const Standard_Boolean theToUpdateViewer)
{
if (theOwner.IsNull() || !theOwner->HasSelectable() || !myFilters->IsOk (theOwner, SelectMgr_FilterReaction_Select))
if (theOwner.IsNull() || !theOwner->HasSelectable() || !myFilters->IsOk (theOwner))
return;
const Handle(AIS_InteractiveObject) anObject = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
@@ -1044,7 +982,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
if (theOwner.IsNull() || !theOwner->HasSelectable())
return;
if (!myFilters->IsOk(theOwner, SelectMgr_FilterReaction_Select) && !theOwner->IsSelected())
if (!myFilters->IsOk(theOwner) && !theOwner->IsSelected())
return;
mySelection->Select (theOwner);
@@ -1052,13 +990,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
if (myAutoHilight)
{
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
if (!myObjects.IsBound(anObj)) // e.g. AIS_ViewCubeFlat is not displayed
return;
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
if (!aStatusPtr)
return;
Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
if (theOwner->IsSelected())
{
highlightSelected (theOwner);
@@ -1069,7 +1001,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
anOwners.Append (theOwner);
unhighlightOwners (anOwners);
(*aStatusPtr)->SetHilightStyle (Handle(Prs3d_Drawer)());
aStatus->SetHilightStyle (Handle(Prs3d_Drawer)());
}
}

View File

@@ -30,7 +30,6 @@
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_AndFilter.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <Standard_Transient.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
@@ -265,74 +264,22 @@ void AIS_InteractiveContext::SubIntensityOff (const Handle(AIS_InteractiveObject
}
}
//=======================================================================
//function : SetFilter
//purpose :
//=======================================================================
void AIS_InteractiveContext::SetFilter (const Handle(SelectMgr_Filter)& theFilter)
{
Handle(SelectMgr_Filter) aDefFilter = myFilters->StoredFilters().First();
if (myFilters->StoredFilters().Size() < 2)
{
myFilters->Clear();
myFilters->Add (aDefFilter);
}
myFilters->Add (theFilter);
}
//=======================================================================
//function : Filter
//purpose :
//=======================================================================
Handle(SelectMgr_Filter) AIS_InteractiveContext::Filter (const Standard_Boolean isGlobalFilter) const
{
if (isGlobalFilter)
return myFilters;
if (myFilters->StoredFilters().Size() < 2)
return NULL;
SelectMgr_ListIteratorOfListOfFilter anIterator (myFilters->StoredFilters());
anIterator.Next();
return anIterator.Value();
}
//=======================================================================
//function : AddFilter
//purpose :
//=======================================================================
void AIS_InteractiveContext::AddFilter(const Handle(SelectMgr_Filter)& theFilter)
void AIS_InteractiveContext::AddFilter(const Handle(SelectMgr_Filter)& aFilter)
{
Handle(SelectMgr_Filter) aFilter = Filter();
if (aFilter.IsNull())
SetFilter (new SelectMgr_OrFilter());
Handle (SelectMgr_CompositionFilter) aCompositeFilter = Handle(SelectMgr_CompositionFilter)::DownCast (aFilter);
if (aCompositeFilter.IsNull())
return;
if (aCompositeFilter->IsIn (theFilter))
return;
aCompositeFilter->Add (theFilter);
myFilters->Add(aFilter);
}
//=======================================================================
//function : RemoveFilter
//purpose :
//=======================================================================
void AIS_InteractiveContext::RemoveFilter(const Handle(SelectMgr_Filter)& theFilter)
void AIS_InteractiveContext::RemoveFilter(const Handle(SelectMgr_Filter)& aFilter)
{
Handle(SelectMgr_Filter) aFilter = Filter();
if (aFilter.IsNull())
return;
Handle (SelectMgr_CompositionFilter) aCompositeFilter = Handle(SelectMgr_CompositionFilter)::DownCast (aFilter);
if (aCompositeFilter.IsNull())
return;
aCompositeFilter->Remove (theFilter);
myFilters->Remove(aFilter);
}
//=======================================================================
@@ -342,24 +289,16 @@ void AIS_InteractiveContext::RemoveFilter(const Handle(SelectMgr_Filter)& theFil
void AIS_InteractiveContext::RemoveFilters()
{
SetFilter (NULL);
myFilters->Clear();
}
//=======================================================================
//function : Filters
//purpose :
//=======================================================================
SelectMgr_ListOfFilter AIS_InteractiveContext::Filters() const
const SelectMgr_ListOfFilter& AIS_InteractiveContext::Filters() const
{
Handle(SelectMgr_Filter) aFilter = Filter();
if (aFilter.IsNull())
return SelectMgr_ListOfFilter();
Handle (SelectMgr_CompositionFilter) aCompositeFilter = Handle(SelectMgr_CompositionFilter)::DownCast (aFilter);
if (aCompositeFilter.IsNull())
return SelectMgr_ListOfFilter();
return aCompositeFilter->StoredFilters();
return myFilters->StoredFilters();
}
//=======================================================================

View File

@@ -23,7 +23,7 @@
#include <Quantity_Color.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_AndFilter.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <Standard_Transient.hxx>
#include <TCollection_AsciiString.hxx>

View File

@@ -18,7 +18,6 @@
#include <AIS_InteractiveContext.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectFillCapping.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectText3d.hxx>
@@ -84,17 +83,6 @@ void AIS_InteractiveObject::SetContext (const Handle(AIS_InteractiveContext)& th
}
}
//-----------------------------------------------------------------------------
void AIS_InteractiveObject::SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers)
{
SelectMgr_SelectableObject::SetTransformPersistence (theTrsfPers);
if (!GetContext().IsNull())
{
GetContext()->UpdateOnTransformPersistence (this);
}
}
//=======================================================================
//function : HasPresentation
//purpose :

View File

@@ -108,11 +108,6 @@ public:
//! Returns the context pointer to the interactive context.
Standard_EXPORT Handle(AIS_InteractiveContext) GetContext() const;
//! Sets up Transform Persistence defining a special Local Coordinate system where this object should be located.
//! Updates the presentation in context if it is not NULL
//! @sa Graphic3d_TransformPers class description
Standard_EXPORT virtual void SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers);
//! Returns TRUE when this object has a presentation in the current DisplayMode()
Standard_EXPORT Standard_Boolean HasPresentation() const;

View File

@@ -1,24 +0,0 @@
// Created on: 2003-05-04
// Created by: Alexander Grigoriev (a-grigoriev@opencascade.com)
// Copyright (c) 2003-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_NArray1Transient_HeaderFile
#define _AIS_NArray1Transient_HeaderFile
#include <SelectMgr_EntityOwner.hxx>
#include <NCollection_Array1.hxx>
typedef NCollection_Array1<Handle(SelectMgr_EntityOwner)> AIS_NArray1OfEntityOwner;
#endif

View File

@@ -44,7 +44,6 @@ AIS_RubberBand::AIS_RubberBand()
myDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0));
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
myDrawer->ShadingAspect()->SetTransparency (1.0);
@@ -67,7 +66,6 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
myDrawer->SetLineAspect (new Prs3d_LineAspect (theLineColor, theLineType, theWidth));
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
myDrawer->ShadingAspect()->SetTransparency (1.0);
@@ -93,7 +91,6 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
myDrawer->ShadingAspect()->SetColor (theFillColor);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_SOLID);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
myDrawer->ShadingAspect()->SetTransparency (theTransparency);

View File

@@ -15,8 +15,6 @@
#include <AIS_Selection.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_SelectionScheme.hxx>
#include <SelectMgr_Filter.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_Selection, Standard_Transient)
@@ -132,132 +130,3 @@ AIS_SelectStatus AIS_Selection::AddSelect (const Handle(SelectMgr_EntityOwner)&
theObject->SetSelected (Standard_True);
return AIS_SS_Added;
}
//=======================================================================
//function : SelectOwners
//purpose :
//=======================================================================
void AIS_Selection::SelectOwners (const AIS_NArray1OfEntityOwner& thePickedOwners,
const AIS_SelectionScheme theSelScheme,
const Handle(SelectMgr_Filter)& theFilter)
{
switch (theSelScheme)
{
case AIS_SelectionScheme_UNKNOWN:
{
return;
}
case AIS_SelectionScheme_ReplaceExtra:
{
// If picked owners is equivalent to the selected then just clear selected
// Else go to AIS_SelectionScheme_Replace
if (thePickedOwners.Size() == myresult.Size())
{
Standard_Boolean isTheSame = Standard_True;
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
if (!myResultMap.IsBound (aSelIter.Value()))
{
isTheSame = Standard_False;
break;
}
}
if (isTheSame)
{
Clear();
return;
}
}
}
case AIS_SelectionScheme_Replace:
{
Clear();
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
appendOwner (aSelIter.Value(), theFilter);
}
return;
}
case AIS_SelectionScheme_Add:
{
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
appendOwner (aSelIter.Value(), theFilter);
}
return;
}
case AIS_SelectionScheme_Remove:
{
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
if (myResultMap.IsBound (aSelIter.Value()))
{
Select (aSelIter.Value());
}
}
return;
}
case AIS_SelectionScheme_XOR:
{
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner)& anOwner = aSelIter.Value();
if (anOwner.IsNull()
|| !anOwner->HasSelectable()
|| !theFilter->IsOk (anOwner, SelectMgr_FilterReaction_Select))
{
continue;
}
Select (anOwner);
}
return;
}
case AIS_SelectionScheme_Clear:
{
Clear();
return;
}
}
}
//=======================================================================
//function : appendOwner
//purpose :
//=======================================================================
AIS_SelectStatus AIS_Selection::appendOwner (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(SelectMgr_Filter)& theFilter)
{
if (theOwner.IsNull()
|| !theOwner->HasSelectable()
|| !theFilter->IsOk (theOwner, SelectMgr_FilterReaction_Select))
{
return AIS_SS_NotDone;
}
return AddSelect (theOwner);
}
//=======================================================================
//function : XOROwner
//purpose :
//=======================================================================
AIS_SelectStatus AIS_Selection::XOROwner (const Handle(SelectMgr_EntityOwner)& theOwner,
const AIS_NListOfEntityOwner& thePreviousSelected,
const Handle(SelectMgr_Filter)& theFilter)
{
if (theOwner.IsNull() || !theOwner->HasSelectable() || !theFilter->IsOk (theOwner, SelectMgr_FilterReaction_Select))
return AIS_SS_NotDone;
if (thePreviousSelected.Contains (theOwner)) // was selected, should not be now
{
if (theOwner->IsSelected())
return Select (theOwner); // deselect
}
else
{
return AddSelect (theOwner); // was not selected, should be now
}
return AIS_SS_NotDone;
}

View File

@@ -18,14 +18,10 @@
#define _AIS_Selection_HeaderFile
#include <AIS_NListOfEntityOwner.hxx>
#include <AIS_NArray1OfEntityOwner.hxx>
#include <AIS_SelectionScheme.hxx>
#include <AIS_SelectStatus.hxx>
#include <Standard.hxx>
#include <Standard_Type.hxx>
class SelectMgr_Filter;
//! Class holding the list of selected owners.
class AIS_Selection : public Standard_Transient
{
@@ -79,33 +75,7 @@ public:
//! Return selected object at iterator position.
const Handle(SelectMgr_EntityOwner)& Value() const { return myIterator.Value(); }
//! Select or deselect owners depending on the selection scheme.
//! @param theOwners [in] elements to change selection state
//! @param theSelScheme [in] selection scheme, defines how owner is selected
//! @param theFilter [in] context filter to skip not acceptable owners
Standard_EXPORT virtual void SelectOwners (const AIS_NArray1OfEntityOwner& thePickedOwners,
const AIS_SelectionScheme theSelScheme,
const Handle(SelectMgr_Filter)& theFilter);
protected:
//! Append the owner into the current selection if filter is Ok.
//! @param theOwner [in] element to change selection state
//! @param theFilter [in] context filter to skip not acceptable owners
//! @return result of selection
Standard_EXPORT virtual AIS_SelectStatus appendOwner (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(SelectMgr_Filter)& theFilter);
//! XOR the owner to the current selection if filter is Ok.
//! \param theOwner element to change selection state
//! \param thePreviousSelected previous selected objects
//! \param theFilter context filter to skip not acceptable owners
//! \return result of selection
Standard_EXPORT virtual AIS_SelectStatus XOROwner (const Handle(SelectMgr_EntityOwner)& theOwner,
const AIS_NListOfEntityOwner& thePreviousSelected,
const Handle(SelectMgr_Filter)& theFilter);
protected:
private:
AIS_NListOfEntityOwner myresult;
AIS_NListOfEntityOwner::Iterator myIterator;

View File

@@ -1,30 +0,0 @@
// Copyright (c) 2019 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_SelectionScheme_HeaderFile
#define _AIS_SelectionScheme_HeaderFile
//! Sets selection schemes for interactive contexts.
enum AIS_SelectionScheme
{
AIS_SelectionScheme_UNKNOWN = -1, //!< undefined scheme
AIS_SelectionScheme_Replace = 0, //!< clears current selection and select detected objects
AIS_SelectionScheme_Add, //!< adds detected object to current selection
AIS_SelectionScheme_Remove, //!< removes detected object from the current selection
AIS_SelectionScheme_XOR, //!< performs XOR for detected objects, other selected not touched
AIS_SelectionScheme_Clear, //!< clears current selection
AIS_SelectionScheme_ReplaceExtra, //!< replace with one difference: if result of replace is an empty,
//!< and current selection contains detected element, it will be selected
};
#endif // _AIS_SelectionScheme_HeaderFile

View File

@@ -176,7 +176,10 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
try
{
OCC_CATCH_SIGNALS
StdPrs_ShadedShape::Add (aPrs, myshape, myDrawer, myDrawer->FillCappingAspect());
StdPrs_ShadedShape::Add (aPrs, myshape, myDrawer,
myDrawer->ShadingAspect()->Aspect()->ToMapTexture()
&& !myDrawer->ShadingAspect()->Aspect()->TextureMap().IsNull(),
myUVOrigin, myUVRepeat, myUVScale);
}
catch (Standard_Failure const& anException)
{

View File

@@ -110,7 +110,7 @@ AIS_ViewController::AIS_ViewController()
myAnchorPointPrs2->SetZLayer (Graphic3d_ZLayerId_Topmost);
myAnchorPointPrs2->SetMutable (true);
myRubberBand = new AIS_RubberBand (Quantity_NOC_LIGHTBLUE, Aspect_TOL_SOLID, Quantity_NOC_LIGHTBLUE4, 0.5, 1.0);
myRubberBand = new AIS_RubberBand (Quantity_NOC_LIGHTBLUE, Aspect_TOL_SOLID, Quantity_NOC_LIGHTBLUE, 0.4, 1.0);
myRubberBand->SetZLayer (Graphic3d_ZLayerId_TopOSD);
myRubberBand->SetTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_2d, Aspect_TOTP_LEFT_UPPER));
myRubberBand->SetDisplayMode (0);
@@ -2377,7 +2377,14 @@ void AIS_ViewController::handleSelectionPick (const Handle(AIS_InteractiveContex
ResetPreviousMoveTo();
}
theCtx->SelectDetected (myGL.Selection.IsXOR ? AIS_SelectionScheme_XOR : AIS_SelectionScheme_Replace);
if (myGL.Selection.IsXOR)
{
theCtx->ShiftSelect (false);
}
else
{
theCtx->Select (false);
}
// selection affects all Views
theView->Viewer()->Invalidate();
@@ -2479,10 +2486,18 @@ void AIS_ViewController::handleSelectionPoly (const Handle(AIS_InteractiveContex
else
{
theCtx->MainSelector()->AllowOverlapDetection (aPnt1.y() != Min (aPnt1.y(), aPnt2.y()));
theCtx->SelectRectangle (Graphic3d_Vec2i (Min (aPnt1.x(), aPnt2.x()), Min (aPnt1.y(), aPnt2.y())),
Graphic3d_Vec2i (Max (aPnt1.x(), aPnt2.x()), Max (aPnt1.y(), aPnt2.y())),
theView,
myGL.Selection.IsXOR ? AIS_SelectionScheme_XOR : AIS_SelectionScheme_Replace);
if (myGL.Selection.IsXOR)
{
theCtx->ShiftSelect (Min (aPnt1.x(), aPnt2.x()), Min (aPnt1.y(), aPnt2.y()),
Max (aPnt1.x(), aPnt2.x()), Max (aPnt1.y(), aPnt2.y()),
theView, false);
}
else
{
theCtx->Select (Min (aPnt1.x(), aPnt2.x()), Min (aPnt1.y(), aPnt2.y()),
Max (aPnt1.x(), aPnt2.x()), Max (aPnt1.y(), aPnt2.y()),
theView, false);
}
theCtx->MainSelector()->AllowOverlapDetection (false);
}
}
@@ -2497,8 +2512,14 @@ void AIS_ViewController::handleSelectionPoly (const Handle(AIS_InteractiveContex
aPolyIter.ChangeValue() = gp_Pnt2d (aNewPnt.x(), -aNewPnt.y());
}
theCtx->SelectPolygon (aPolyline, theView,
myGL.Selection.IsXOR ? AIS_SelectionScheme_XOR : AIS_SelectionScheme_Replace);
if (myGL.Selection.IsXOR)
{
theCtx->ShiftSelect (aPolyline, theView, false);
}
else
{
theCtx->Select (aPolyline, theView, false);
}
theCtx->MainSelector()->AllowOverlapDetection (false);
}
}

View File

@@ -73,7 +73,6 @@ AIS_MultipleConnectedInteractive.hxx
AIS_MultipleConnectedInteractive.lxx
AIS_NavigationMode.hxx
AIS_NListOfEntityOwner.hxx
AIS_NArray1OfEntityOwner.hxx
AIS_Plane.cxx
AIS_Plane.hxx
AIS_PlaneTrihedron.cxx
@@ -89,7 +88,6 @@ AIS_Selection.cxx
AIS_Selection.hxx
AIS_SelectStatus.hxx
AIS_SelectionModesConcurrency.hxx
AIS_SelectionScheme.hxx
AIS_SequenceOfInteractive.hxx
AIS_Shape.cxx
AIS_Shape.hxx

View File

@@ -23,7 +23,6 @@
#include <Aspect_Background.hxx>
#include <Quantity_Color.hxx>
#include <Standard_Dump.hxx>
//-Aliases
//-Global data definitions
@@ -57,12 +56,3 @@ Quantity_Color Aspect_Background::Color () const {
return (MyColor);
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Aspect_Background::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor)
}

View File

@@ -46,9 +46,6 @@ public:
//! Returns the colour of the window background <me>.
Standard_EXPORT Quantity_Color Color() const;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;

View File

@@ -140,20 +140,3 @@ void Aspect_CircularGrid::Init () {
myAlpha = M_PI / Standard_Real(myDivisionNumber);
myA1 = Cos(myAlpha); myB1=Sin(myAlpha);
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Aspect_CircularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Grid)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRadiusStep)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDivisionNumber)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlpha)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myA1)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myB1)
}

View File

@@ -55,9 +55,6 @@ public:
Standard_EXPORT Standard_Integer DivisionNumber() const;
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:

View File

@@ -18,8 +18,6 @@
#include <Aspect_GenId.hxx>
#include <Aspect_IdentDefinitionError.hxx>
#include <Standard_Dump.hxx>
// =======================================================================
// function : Aspect_GenId
// purpose :
@@ -116,21 +114,3 @@ Standard_Boolean Aspect_GenId::Next (Standard_Integer& theId)
theId = myLowerBound + myLength - myFreeCount - 1;
return Standard_True;
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Aspect_GenId::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFreeCount)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLength)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLowerBound)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUpperBound)
for (TColStd_ListOfInteger::Iterator anIter (myFreeIds); anIter.More(); anIter.Next())
{
Standard_Integer aFreeId = anIter.Value();
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aFreeId)
}
}

View File

@@ -72,9 +72,6 @@ public:
//! Returns the upper identifier in range.
Standard_Integer Upper() const { return myUpperBound; }
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
private:

View File

@@ -55,15 +55,3 @@ Aspect_GradientFillMethod Aspect_GradientBackground::BgGradientFillMethod( ) con
{
return MyGradientMethod;
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Aspect_GradientBackground::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Background)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor2)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyGradientMethod)
}

View File

@@ -51,9 +51,6 @@ public:
//! Returns the current gradient background fill mode.
Standard_EXPORT Aspect_GradientFillMethod BgGradientFillMethod() const;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -104,22 +104,3 @@ void Aspect_Grid::SetDrawMode (const Aspect_GridDrawMode theDrawMode)
myDrawMode = theDrawMode;
UpdateDisplay();
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Aspect_Grid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRotationAngle)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXOrigin)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYOrigin)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColor)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTenthColor)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawMode)
}

View File

@@ -96,9 +96,6 @@ public:
Standard_EXPORT virtual Standard_Boolean IsDisplayed() const = 0;
Standard_EXPORT virtual void Init() = 0;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:

View File

@@ -155,25 +155,3 @@ Standard_Boolean Aspect_RectangularGrid::CheckAngle(const Standard_Real alpha,
const Standard_Real beta) const {
return (Abs( Sin(alpha) * Cos(beta + M_PI / 2.) - Cos(alpha) * Sin(beta + M_PI / 2.)) != 0) ;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Aspect_RectangularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Grid)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXStep)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYStep)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirstAngle)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySecondAngle)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, a1)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, b1)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, c1)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, a2)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, b2)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, c2)
}

View File

@@ -67,9 +67,6 @@ public:
Standard_EXPORT Standard_Real SecondAngle() const;
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:

View File

@@ -92,18 +92,3 @@ void Aspect_Window::SetBackground (const Quantity_Color& theFirstColor,
{
MyGradientBackground.SetColors (theFirstColor, theSecondColor, theFillMethod);
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Aspect_Window::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyBackground)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyGradientBackground)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyBackgroundFillMethod)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyIsVirtual)
}

View File

@@ -114,9 +114,6 @@ public:
//! on platforms implementing thread-unsafe connections to display.
//! NULL can be passed instead otherwise.
virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp) { (void )theDisp; }
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
DEFINE_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)

View File

@@ -149,7 +149,7 @@ void BRepExtrema_DistShapeShape::DistanceMapMap (const TopTools_IndexedMapOfShap
const TopoDS_Shape& aShape1 = theMap1 (aPair.Index1);
const TopoDS_Shape& aShape2 = theMap2 (aPair.Index2);
BRepExtrema_DistanceSS aDistTool (aShape1, aShape2, aBox1, aBox2, myDistRef, myEps);
BRepExtrema_DistanceSS aDistTool (aShape1, aShape2, aBox1, aBox2, myDistRef, myEps, myFlag);
if (aDistTool.IsDone())
{
if (aDistTool.DistValue() < myDistRef - myEps)
@@ -194,8 +194,7 @@ BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape()
myEps (Precision::Confusion()),
myIsInitS1 (Standard_False),
myIsInitS2 (Standard_False),
myFlag (Extrema_ExtFlag_MINMAX),
myAlgo (Extrema_ExtAlgo_Grad)
myFlag (Extrema_ExtFlag_MINMAX)
{
//
}
@@ -206,16 +205,14 @@ BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape()
//=======================================================================
BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,
const TopoDS_Shape& Shape2,
const Extrema_ExtFlag F,
const Extrema_ExtAlgo A)
const Extrema_ExtFlag F)
: myDistRef (0.0),
myIsDone (Standard_False),
myInnerSol (Standard_False),
myEps (Precision::Confusion()),
myIsInitS1 (Standard_False),
myIsInitS2 (Standard_False),
myFlag (F),
myAlgo (A)
myFlag (F)
{
LoadS1(Shape1);
LoadS2(Shape2);
@@ -230,16 +227,14 @@ BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape
BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,
const TopoDS_Shape& Shape2,
const Standard_Real theDeflection,
const Extrema_ExtFlag F,
const Extrema_ExtAlgo A)
const Extrema_ExtFlag F)
: myDistRef (0.0),
myIsDone (Standard_False),
myInnerSol (Standard_False),
myEps (theDeflection),
myIsInitS1 (Standard_False),
myIsInitS2 (Standard_False),
myFlag (F),
myAlgo (A)
myFlag (F)
{
LoadS1(Shape1);
LoadS2(Shape2);

View File

@@ -18,7 +18,6 @@
#include <BRepExtrema_SeqOfSolution.hxx>
#include <BRepExtrema_SolutionElem.hxx>
#include <BRepExtrema_SupportType.hxx>
#include <Extrema_ExtAlgo.hxx>
#include <Extrema_ExtFlag.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS_Shape.hxx>
@@ -39,9 +38,9 @@ class BRepExtrema_DistShapeShape
Standard_EXPORT BRepExtrema_DistShapeShape();
//! computation of the minimum distance (value and pair of points) using default deflection <br>
//! Default value is Precision::Confusion(). <br>
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Extrema_ExtFlag F = Extrema_ExtFlag_MIN);
//! create tool and load both shapes into it <br>
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Standard_Real theDeflection,const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Standard_Real theDeflection,const Extrema_ExtFlag F = Extrema_ExtFlag_MIN);
void SetDeflection(const Standard_Real theDeflection)
{
@@ -129,11 +128,6 @@ class BRepExtrema_DistShapeShape
myFlag = F;
}
void SetAlgo(const Extrema_ExtAlgo A)
{
myAlgo = A;
}
private:
//! computes the minimum distance between two maps of shapes (Face,Edge,Vertex) <br>
@@ -156,7 +150,6 @@ private:
Standard_Boolean myIsInitS1;
Standard_Boolean myIsInitS2;
Extrema_ExtFlag myFlag;
Extrema_ExtAlgo myAlgo;
Bnd_SeqOfBox myBV1;
Bnd_SeqOfBox myBV2;
Bnd_SeqOfBox myBE1;

View File

@@ -772,7 +772,7 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Vertex& S1, const TopoDS_Face&
const Standard_Real Dst=B1.Distance(B2);
if ((Dst < myDstRef - myEps) || (fabs(Dst-myDstRef) < myEps))
{
BRepExtrema_ExtPF Ext(S1,S2,myFlag,myAlgo);
BRepExtrema_ExtPF Ext(S1,S2,myFlag);
const Standard_Integer NbExtrema = Ext.IsDone()? Ext.NbExt() : 0;
if ( NbExtrema > 0 )
{
@@ -828,7 +828,7 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Face& S1, const TopoDS_Vertex&
const Standard_Real Dst=B1.Distance(B2);
if ((Dst < myDstRef - myEps) || (fabs(Dst-myDstRef) < myEps))
{
BRepExtrema_ExtPF Ext(S2,S1,myFlag,myAlgo);
BRepExtrema_ExtPF Ext(S2,S1,myFlag);
const Standard_Integer NbExtrema = Ext.IsDone()? Ext.NbExt() : 0;
if ( NbExtrema > 0 )
{

View File

@@ -16,7 +16,6 @@
#include <BRepExtrema_SeqOfSolution.hxx>
#include <Extrema_ExtFlag.hxx>
#include <Extrema_ExtAlgo.hxx>
#include <Precision.hxx>
#include <Standard_DefineAlloc.hxx>
@@ -39,9 +38,8 @@ class BRepExtrema_DistanceSS
BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
const Bnd_Box& B1, const Bnd_Box& B2,
const Standard_Real DstRef,
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,
const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad)
: myDstRef(DstRef), myModif(Standard_False), myEps(Precision::Confusion()), myFlag(F), myAlgo(A)
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX)
: myDstRef(DstRef), myModif(Standard_False), myEps(Precision::Confusion()), myFlag(F)
{
Perform(S1, S2, B1, B2);
}
@@ -52,9 +50,8 @@ class BRepExtrema_DistanceSS
BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
const Bnd_Box& B1, const Bnd_Box& B2,
const Standard_Real DstRef, const Standard_Real aDeflection,
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,
const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad)
: myDstRef(DstRef), myModif(Standard_False), myEps(aDeflection), myFlag(F), myAlgo(A)
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX)
: myDstRef(DstRef), myModif(Standard_False), myEps(aDeflection), myFlag(F)
{
Perform(S1, S2, B1, B2);
}
@@ -83,11 +80,6 @@ class BRepExtrema_DistanceSS
{
myFlag = F;
}
//! sets the flag controlling ...
void SetAlgo(const Extrema_ExtAlgo A)
{
myAlgo = A;
}
private:
@@ -130,7 +122,6 @@ class BRepExtrema_DistanceSS
Standard_Boolean myModif;
Standard_Real myEps;
Extrema_ExtFlag myFlag;
Extrema_ExtAlgo myAlgo;
};
#endif

View File

@@ -32,9 +32,9 @@
//=======================================================================
BRepExtrema_ExtPF::BRepExtrema_ExtPF(const TopoDS_Vertex& TheVertex, const TopoDS_Face& TheFace,
const Extrema_ExtFlag TheFlag, const Extrema_ExtAlgo TheAlgo)
const Extrema_ExtFlag TheFlag)
{
Initialize(TheFace,TheFlag,TheAlgo);
Initialize(TheFace,TheFlag);
Perform(TheVertex,TheFace);
}
@@ -44,7 +44,7 @@ BRepExtrema_ExtPF::BRepExtrema_ExtPF(const TopoDS_Vertex& TheVertex, const TopoD
//=======================================================================
void BRepExtrema_ExtPF::Initialize(const TopoDS_Face& TheFace,
const Extrema_ExtFlag TheFlag, const Extrema_ExtAlgo TheAlgo)
const Extrema_ExtFlag TheFlag)
{
// cette surface doit etre en champ. Extrema ne fait
// pas de copie et prend seulement un pointeur dessus.
@@ -60,7 +60,6 @@ void BRepExtrema_ExtPF::Initialize(const TopoDS_Face& TheFace,
Standard_Real U1, U2, V1, V2;
BRepTools::UVBounds(TheFace, U1, U2, V1, V2);
myExtPS.SetFlag(TheFlag);
myExtPS.SetAlgo(TheAlgo);
myExtPS.Initialize(mySurf, U1, U2, V1, V2, aTolU, aTolV);
}

View File

@@ -21,7 +21,6 @@
#include <Extrema_SequenceOfPOnSurf.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <Extrema_ExtFlag.hxx>
#include <Extrema_ExtAlgo.hxx>
class TopoDS_Vertex;
class TopoDS_Face;
@@ -38,12 +37,10 @@ class BRepExtrema_ExtPF
{}
//! It calculates all the distances. <br>
Standard_EXPORT BRepExtrema_ExtPF(const TopoDS_Vertex& TheVertex,const TopoDS_Face& TheFace,
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX);
Standard_EXPORT void Initialize(const TopoDS_Face& TheFace,
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX);
//! An exception is raised if the fields have not been initialized. <br>
//! Be careful: this method uses the Face only for classify not for the fields. <br>
@@ -79,11 +76,6 @@ class BRepExtrema_ExtPF
myExtPS.SetFlag(F);
}
void SetAlgo(const Extrema_ExtAlgo A)
{
myExtPS.SetAlgo(A);
}
private:
Extrema_ExtPS myExtPS;

View File

@@ -23,6 +23,7 @@
#include <BRepLib_MakeFace.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
#include <GCPnts.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
@@ -178,39 +179,6 @@ BRepLib_FindSurface::BRepLib_FindSurface(const TopoDS_Shape& S,
namespace
{
static void fillParams (const TColStd_Array1OfReal& theKnots,
Standard_Integer theDegree,
Standard_Real theParMin,
Standard_Real theParMax,
NCollection_Vector<Standard_Real>& theParams)
{
Standard_Real aPrevPar = theParMin;
theParams.Append (aPrevPar);
Standard_Integer aNbP = Max (theDegree, 1);
for (Standard_Integer i = 1;
(i < theKnots.Length()) && (theKnots (i) < (theParMax - Precision::PConfusion())); ++i)
{
if (theKnots (i + 1) < theParMin + Precision::PConfusion())
continue;
Standard_Real aStep = (theKnots (i + 1) - theKnots (i)) / aNbP;
for (Standard_Integer k = 1; k <= aNbP ; ++k)
{
Standard_Real aPar = theKnots (i) + k * aStep;
if (aPar > theParMax - Precision::PConfusion())
break;
if (aPar > aPrevPar + Precision::PConfusion())
{
theParams.Append (aPar);
aPrevPar = aPar;
}
}
}
theParams.Append (theParMax);
}
static void fillPoints (const BRepAdaptor_Curve& theCurve,
const NCollection_Vector<Standard_Real> theParams,
@@ -358,13 +326,13 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
aKnots.SetValue (1, GC->FirstParameter());
aKnots.SetValue (2, GC->LastParameter());
fillParams (aKnots, GC->Degree(), dfUf, dfUl, aParams);
GCPnts::FillParams (aKnots, GC->Degree(), dfUf, dfUl, aParams);
break;
}
case GeomAbs_BSplineCurve:
{
Handle(Geom_BSplineCurve) GC = c.BSpline();
fillParams (GC->Knots(), GC->Degree(), dfUf, dfUl, aParams);
GCPnts::FillParams (GC->Knots(), GC->Degree(), dfUf, dfUl, aParams);
break;
}
case GeomAbs_Line:
@@ -391,7 +359,7 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
aBounds.SetValue (1, dfUf);
aBounds.SetValue (2, dfUl);
fillParams (aBounds, iNbPoints - 1, dfUf, dfUl, aParams);
GCPnts::FillParams (aBounds, iNbPoints - 1, dfUf, dfUl, aParams);
}
}

View File

@@ -77,7 +77,7 @@ static Standard_Integer distmini(Draw_Interpretor& di, Standard_Integer n, const
if (n == 5)
aDeflection = Draw::Atof(a[4]);
BRepExtrema_DistShapeShape dst(S1 ,S2, aDeflection);
BRepExtrema_DistShapeShape dst(S1 ,S2, aDeflection, Extrema_ExtFlag_MIN);
if (dst.IsDone())
{

View File

@@ -617,9 +617,9 @@ static Standard_Integer getedgeregul
//=======================================================================
static Standard_Integer projponf(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (n < 3 || n > 5) {
if (n < 3 || n > 4) {
di << "Project point on the face.\n";
di << "Usage: projponf face pnt [extrema flag: -min/-max/-minmax] [extrema algo: -g(grad)/-t(tree)]\n";
di << "Usage: projponf face pnt [extrema flag: -min/-max/-minmax]\n";
return 1;
}
// get face
@@ -642,7 +642,6 @@ static Standard_Integer projponf(Draw_Interpretor& di, Standard_Integer n, const
//
// get projection options
// default values;
Extrema_ExtAlgo anExtAlgo = Extrema_ExtAlgo_Grad;
Extrema_ExtFlag anExtFlag = Extrema_ExtFlag_MINMAX;
//
for (Standard_Integer i = 3; i < n; ++i) {
@@ -655,12 +654,6 @@ static Standard_Integer projponf(Draw_Interpretor& di, Standard_Integer n, const
else if (!strcasecmp(a[i], "-minmax")) {
anExtFlag = Extrema_ExtFlag_MINMAX;
}
else if (!strcasecmp(a[i], "-t")) {
anExtAlgo = Extrema_ExtAlgo_Tree;
}
else if (!strcasecmp(a[i], "-g")) {
anExtAlgo = Extrema_ExtAlgo_Grad;
}
}
//
// get surface
@@ -677,7 +670,6 @@ static Standard_Integer projponf(Draw_Interpretor& di, Standard_Integer n, const
GeomAPI_ProjectPointOnSurf aProjPS;
aProjPS.Init(aSurf, aUMin, aUMax, aVMin, aVMax);
// set the options
aProjPS.SetExtremaAlgo(anExtAlgo);
aProjPS.SetExtremaFlag(anExtFlag);
// perform projection
aProjPS.Perform(aP);
@@ -766,7 +758,7 @@ void BRepTest::SurfaceCommands(Draw_Interpretor& theCommands)
theCommands.Add ("getedgeregularity", "getedgeregularity edge face1 [face2]", __FILE__,getedgeregul,g);
theCommands.Add ("projponf",
"projponf face pnt [extrema flag: -min/-max/-minmax] [extrema algo: -g(grad)/-t(tree)]\n"
"projponf face pnt [extrema flag: -min/-max/-minmax]\n"
"\t\tProject point on the face.",
__FILE__, projponf, g);
}

View File

@@ -201,51 +201,6 @@ public:
}
}
//! Inits the content of me into the stream
Standard_Boolean InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
{
Standard_Integer aPos = theStreamPos;
Standard_Integer anIsInited = 0;
OCCT_INIT_FIELD_VALUE_INTEGER (theSStream, aPos, anIsInited);
myIsInited = anIsInited != 0;
int n = Min (N, 3);
if (n == 1)
{
Standard_Real aValue;
OCCT_INIT_FIELD_VALUE_REAL (theSStream, aPos, aValue);
myMinPoint[0] = (T)aValue;
}
if (n == 2)
{
Standard_Real aValue1, aValue2;
OCCT_INIT_VECTOR_CLASS (theSStream, "MinPoint", aPos, n, &aValue1, &aValue2);
myMinPoint[0] = (T)aValue1;
myMinPoint[1] = (T)aValue2;
OCCT_INIT_VECTOR_CLASS (theSStream, "MaxPoint", aPos, n, &aValue1, &aValue2);
myMaxPoint[0] = (T)aValue1;
myMaxPoint[1] = (T)aValue2;
}
if (n == 3)
{
Standard_Real aValue1, aValue2, aValue3;
OCCT_INIT_VECTOR_CLASS (theSStream, "MinPoint", aPos, n, &aValue1, &aValue2, &aValue3);
myMinPoint[0] = (T)aValue1;
myMinPoint[1] = (T)aValue2;
myMinPoint[2] = (T)aValue3;
OCCT_INIT_VECTOR_CLASS (theSStream, "MaxPoint", aPos, n, &aValue1, &aValue2, &aValue3);
myMaxPoint[0] = (T)aValue1;
myMaxPoint[1] = (T)aValue2;
myMaxPoint[2] = (T)aValue3;
}
theStreamPos = aPos;
return Standard_True;
}
public:
//! Checks if the Box is out of the other box.

View File

@@ -66,6 +66,18 @@ public: //! @name Adding elements in BVH
BVH_Object<NumType, Dimension>::myIsDirty = Standard_True;
}
//! Allows to update the box of the element while the tree is not yet built
virtual void UpdateBox (const Standard_Integer theId, const BVH_Box<NumType, Dimension>& theNewBox)
{
if (BVH_Object<NumType, Dimension>::myIsDirty)
{
if (theId >= 0 && theId < Size())
{
myBoxes[theId] = theNewBox;
}
}
}
public: //! @name BVH construction
//! BVH construction

View File

@@ -84,7 +84,7 @@ public: //! @name Necessary overrides for BVH construction
//! Returns the bounding box with the given index.
virtual BVH_Box <NumType, Dimension> Box (const Standard_Integer theIndex) const Standard_OVERRIDE
{
return myBoxes[myIndices[theIndex]];
return this->myBoxes[myIndices[theIndex]];
}
//! Swaps indices of two specified boxes.
@@ -97,7 +97,7 @@ public: //! @name Necessary overrides for BVH construction
//! Returns the Element with the index theIndex.
virtual DataType Element (const Standard_Integer theIndex) const
{
return myElements[myIndices[theIndex]];
return this->myElements[myIndices[theIndex]];
}
protected: //! @name Fields

View File

@@ -88,6 +88,24 @@ public: //! @name Point-Box Square distance
return aDist;
}
//! Computes Max square distance between point and bounding box
static T PointBoxMaxSquareDistance (const BVH_VecNt& thePoint,
const BVH_VecNt& theCMin,
const BVH_VecNt& theCMax)
{
T aDist = 0;
for (int i = 0; i < N; ++i)
{
T dmin = 0, dmax = 0;
if (thePoint[i] > theCMin[i]) { dmin = thePoint[i] - theCMin[i]; }
if (thePoint[i] < theCMax[i]) { dmax = theCMax[i] - thePoint[i]; }
T d = dmin > dmax ? dmin : dmax;
d *= d;
aDist += d;
}
return aDist;
}
public: //! @name Point-Box projection
//! Computes projection of point on bounding box
@@ -110,7 +128,6 @@ public: //! @name Point-Box projection
{
return thePoint.cwiseMax (theCMin).cwiseMin (theCMax);
}
public: //! @name Point-Triangle Square distance
//! Computes square distance between point and triangle

View File

@@ -35,6 +35,8 @@
#include <BinMXCAFDoc_MaterialToolDriver.hxx>
#include <BinMXCAFDoc_NoteDriver.hxx>
#include <BinMXCAFDoc_NoteBalloonDriver.hxx>
#include <BinMXCAFDoc_NoteBinDataDriver.hxx>
#include <BinMXCAFDoc_NoteCommentDriver.hxx>
#include <BinMXCAFDoc_NotesToolDriver.hxx>
#include <BinMXCAFDoc_ShapeToolDriver.hxx>
#include <BinMXCAFDoc_ViewDriver.hxx>
@@ -79,7 +81,8 @@ void BinMXCAFDoc::AddDrivers(const Handle(BinMDF_ADriverTable)& theDriverTable,
theDriverTable->AddDriver( new BinMXCAFDoc_MaterialDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_VisMaterialDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_NoteBalloonDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_NoteDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_NoteBinDataDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_NoteCommentDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_ViewDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_ColorToolDriver (theMsgDrv));

View File

@@ -42,9 +42,6 @@ class BinMXCAFDoc_DimTolToolDriver;
class BinMXCAFDoc_MaterialToolDriver;
class BinMXCAFDoc_ViewDriver;
class BinMXCAFDoc_ViewToolDriver;
class BinMXCAFDoc_AnimationDriver;
class BinMXCAFDoc_AnimationToolDriver;
@@ -92,9 +89,6 @@ friend class BinMXCAFDoc_DimTolToolDriver;
friend class BinMXCAFDoc_MaterialToolDriver;
friend class BinMXCAFDoc_ViewDriver;
friend class BinMXCAFDoc_ViewToolDriver;
friend class BinMXCAFDoc_AnimationDriver;
friend class BinMXCAFDoc_AnimationToolDriver;
};

View File

@@ -1,112 +0,0 @@
// Created on: 2017-10-02
// Created by: Elena MOZOKHINA
// Copyright (c) 2016 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinMXCAFDoc_AnimationDriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TDF_Attribute.hxx>
#include <XCAFDoc_Animation.hxx>
# include <TColStd_HArray1OfByte.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationDriver,BinMDF_ADriver)
static Standard_Boolean getByteArray(const BinObjMgt_Persistent& theSource, Handle(TColStd_HArray1OfByte)& theArray)
{
Standard_Integer aFirstInd, aLastInd;
if (!(theSource >> aFirstInd >> aLastInd))
return Standard_False;
if (aLastInd < aFirstInd)
return Standard_False;
theArray.reset(new TColStd_HArray1OfByte(aFirstInd, aLastInd - aFirstInd + 1));
theSource.GetByteArray(&theArray->ChangeFirst(), aLastInd - aFirstInd + 1);
return Standard_True;
}
static void putByteArray(BinObjMgt_Persistent& theTarget, const Handle(TColStd_HArray1OfByte)& theArray)
{
if (theArray.IsNull())
return;
const Standard_Integer aFirstInd = theArray->Lower();
const Standard_Integer aLastInd = theArray->Upper();
if (aLastInd < aFirstInd)
return;
theTarget << aFirstInd << aLastInd;
theTarget.PutByteArray(&theArray->ChangeFirst(), aLastInd - aFirstInd + 1);
}
//=======================================================================
//function : Constructor
//purpose :
//=======================================================================
BinMXCAFDoc_AnimationDriver::BinMXCAFDoc_AnimationDriver
(const Handle(Message_Messenger)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Animation)->Name())
{
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_AnimationDriver::NewEmpty() const
{
return new XCAFDoc_Animation();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_AnimationDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Animation) anAtt = Handle(XCAFDoc_Animation)::DownCast(theTarget);
Standard_Real aDensity;
TCollection_AsciiString aName;
if (!(theSource >> aName))
return Standard_False;
Handle(TColStd_HArray1OfByte) anImage, anAnimation;
if (!getByteArray(theSource, anImage) || anImage.IsNull())
return Standard_False;
if (!getByteArray(theSource, anAnimation) || anAnimation.IsNull())
return Standard_False;
anAtt->Set(new TCollection_HAsciiString(aName), anImage, anAnimation);
return Standard_True;
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void BinMXCAFDoc_AnimationDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Animation) anAtt = Handle(XCAFDoc_Animation)::DownCast(theSource);
Handle(TCollection_HAsciiString) aName = anAtt->GetName();
if (!aName.IsNull())
theTarget << aName->String();
putByteArray(theTarget, anAtt->GetImage());
putByteArray(theTarget, anAtt->GetAnimation());
}

View File

@@ -1,72 +0,0 @@
// Created on: 2017-10-02
// Created by: Elena MOZOKHINA
// Copyright (c) 2016 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMXCAFDoc_AnimationDriver_HeaderFile
#define _BinMXCAFDoc_AnimationDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <BinMDF_ADriver.hxx>
#include <Standard_Boolean.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
class Message_Messenger;
class TDF_Attribute;
class BinObjMgt_Persistent;
class BinMXCAFDoc_AnimationDriver;
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_AnimationDriver, BinMDF_ADriver)
class BinMXCAFDoc_AnimationDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMXCAFDoc_AnimationDriver(const Handle(Message_Messenger)& theMsgDriver);
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Paste (const BinObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& theSource, BinObjMgt_Persistent& theTarget, BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationDriver,BinMDF_ADriver)
protected:
private:
};
#endif // _BinMXCAFDoc_AnimationDriver_HeaderFile

View File

@@ -1,65 +0,0 @@
// Created on: 2017-10-02
// Created by: Elena MOZOKHINA
// Copyright (c) 2016 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinMXCAFDoc_AnimationToolDriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TDF_Attribute.hxx>
#include <XCAFDoc_AnimationTool.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationToolDriver, BinMDF_ADriver)
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_AnimationToolDriver::BinMXCAFDoc_AnimationToolDriver
(const Handle(Message_Messenger)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_AnimationTool)->Name())
{
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_AnimationToolDriver::NewEmpty() const
{
return new XCAFDoc_AnimationTool();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_AnimationToolDriver::Paste
(const BinObjMgt_Persistent& /*theSource*/,
const Handle(TDF_Attribute)& /*theTarget*/,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_AnimationToolDriver::Paste
(const Handle(TDF_Attribute)& /*theSource*/,
BinObjMgt_Persistent& /*theTarget*/,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const {
}

View File

@@ -1,50 +0,0 @@
// Created on: 2017-10-02
// Created by: Elena MOZOKHINA
// Copyright (c) 2016 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMXCAFDoc_AnimationToolDriver_HeaderFile
#define _BinMXCAFDoc_AnimationToolDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <BinMDF_ADriver.hxx>
#include <Standard_Boolean.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
class Message_Messenger;
class TDF_Attribute;
class BinObjMgt_Persistent;
class BinMXCAFDoc_AnimationToolDriver;
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_AnimationToolDriver, BinMDF_ADriver)
class BinMXCAFDoc_AnimationToolDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMXCAFDoc_AnimationToolDriver(const Handle(Message_Messenger)& theMsgDriver);
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Paste(const BinObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
Standard_EXPORT virtual void Paste(const Handle(TDF_Attribute)& theSource, BinObjMgt_Persistent& theTarget, BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationToolDriver, BinMDF_ADriver)
};
#endif // _BinMXCAFDoc_AnimationToolDriver_HeaderFile

View File

@@ -20,14 +20,14 @@
#include <BinMXCAFDoc_NoteBalloonDriver.hxx>
#include <XCAFDoc_NoteBalloon.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NoteBalloonDriver, BinMXCAFDoc_NoteDriver)
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NoteBalloonDriver, BinMXCAFDoc_NoteCommentDriver)
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_NoteBalloonDriver::BinMXCAFDoc_NoteBalloonDriver(const Handle(Message_Messenger)& theMsgDriver)
: BinMXCAFDoc_NoteDriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_NoteBalloon)->Name())
: BinMXCAFDoc_NoteCommentDriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_NoteBalloon)->Name())
{
}
@@ -40,52 +40,13 @@ Handle(TDF_Attribute) BinMXCAFDoc_NoteBalloonDriver::NewEmpty() const
return new XCAFDoc_NoteBalloon();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_NoteBalloonDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const
{
if (!BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable))
return Standard_False;
Handle(XCAFDoc_NoteBalloon) aNote = Handle(XCAFDoc_NoteBalloon)::DownCast(theTarget);
if (aNote.IsNull())
return Standard_False;
TCollection_ExtendedString aComment;
if (!(theSource >> aComment))
return Standard_False;
aNote->Set(aComment);
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_NoteBalloonDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const
{
BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable);
Handle(XCAFDoc_NoteBalloon) aNote = Handle(XCAFDoc_NoteBalloon)::DownCast(theSource);
if (!aNote.IsNull())
theTarget << aNote->Get();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_NoteBalloonDriver::BinMXCAFDoc_NoteBalloonDriver(const Handle(Message_Messenger)& theMsgDriver,
Standard_CString theName)
: BinMXCAFDoc_NoteDriver(theMsgDriver, theName)
: BinMXCAFDoc_NoteCommentDriver(theMsgDriver, theName)
{
}

View File

@@ -16,28 +16,20 @@
#ifndef _BinMXCAFDoc_NoteBalloonDriver_HeaderFile
#define _BinMXCAFDoc_NoteBalloonDriver_HeaderFile
#include <BinMXCAFDoc_NoteDriver.hxx>
#include <BinMXCAFDoc_NoteCommentDriver.hxx>
class BinMXCAFDoc_NoteBalloonDriver;
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_NoteBalloonDriver, BinMXCAFDoc_NoteDriver)
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_NoteBalloonDriver, BinMXCAFDoc_NoteCommentDriver)
class BinMXCAFDoc_NoteBalloonDriver : public BinMXCAFDoc_NoteDriver
class BinMXCAFDoc_NoteBalloonDriver : public BinMXCAFDoc_NoteCommentDriver
{
public:
Standard_EXPORT BinMXCAFDoc_NoteBalloonDriver(const Handle(Message_Messenger)& theMsgDriver);
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
Standard_EXPORT void Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_NoteBalloonDriver, BinMXCAFDoc_NoteDriver)
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_NoteBalloonDriver, BinMXCAFDoc_NoteCommentDriver)
protected:

View File

@@ -0,0 +1,96 @@
// Created on: 2017-02-13
// Created by: Eugeny NIKONOV
// Copyright (c) 2005-2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TDF_Attribute.hxx>
#include <TColStd_HArray1OfByte.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <BinMXCAFDoc_NoteBinDataDriver.hxx>
#include <XCAFDoc_NoteBinData.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NoteBinDataDriver, BinMXCAFDoc_NoteDriver)
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_NoteBinDataDriver::BinMXCAFDoc_NoteBinDataDriver(const Handle(Message_Messenger)& theMsgDriver)
: BinMXCAFDoc_NoteDriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_NoteBinData)->Name())
{
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_NoteBinDataDriver::NewEmpty() const
{
return new XCAFDoc_NoteBinData();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_NoteBinDataDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const
{
if (!BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable))
return Standard_False;
Handle(XCAFDoc_NoteBinData) aNote = Handle(XCAFDoc_NoteBinData)::DownCast(theTarget);
if (aNote.IsNull())
return Standard_False;
TCollection_ExtendedString aTitle;
TCollection_AsciiString aMIMEtype;
Standard_Integer nbSize;
if (!(theSource >> aTitle >> aMIMEtype >> nbSize))
return Standard_False;
Handle(TColStd_HArray1OfByte) aData;
if (nbSize > 0)
{
aData.reset(new TColStd_HArray1OfByte(1, nbSize));
theSource.GetByteArray(&aData->ChangeFirst(), nbSize);
}
aNote->Set(aTitle, aMIMEtype, aData);
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_NoteBinDataDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const
{
BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable);
Handle(XCAFDoc_NoteBinData) aNote = Handle(XCAFDoc_NoteBinData)::DownCast(theSource);
if (!aNote.IsNull())
{
theTarget << aNote->Title() << aNote->MIMEtype() << aNote->Size();
if (aNote->Size() > 0)
theTarget.PutByteArray(&aNote->Data()->ChangeFirst(), aNote->Size());
}
}

View File

@@ -0,0 +1,44 @@
// Created on: 2017-02-13
// Created by: Sergey NIKONOV
// Copyright (c) 2005-2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMXCAFDoc_NoteBinDataDriver_HeaderFile
#define _BinMXCAFDoc_NoteBinDataDriver_HeaderFile
#include <BinMXCAFDoc_NoteDriver.hxx>
class BinMXCAFDoc_NoteBinDataDriver;
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_NoteBinDataDriver, BinMXCAFDoc_NoteDriver)
class BinMXCAFDoc_NoteBinDataDriver : public BinMXCAFDoc_NoteDriver
{
public:
Standard_EXPORT BinMXCAFDoc_NoteBinDataDriver(const Handle(Message_Messenger)& theMsgDriver);
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_NoteBinDataDriver, BinMXCAFDoc_NoteDriver)
};
#endif // _BinMXCAFDoc_NoteBinDataDriver_HeaderFile

View File

@@ -0,0 +1,91 @@
// Created on: 2017-02-13
// Created by: Eugeny NIKONOV
// Copyright (c) 2005-2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TDF_Attribute.hxx>
#include <BinMXCAFDoc_NoteCommentDriver.hxx>
#include <XCAFDoc_NoteComment.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NoteCommentDriver, BinMXCAFDoc_NoteDriver)
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_NoteCommentDriver::BinMXCAFDoc_NoteCommentDriver(const Handle(Message_Messenger)& theMsgDriver)
: BinMXCAFDoc_NoteDriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_NoteComment)->Name())
{
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_NoteCommentDriver::NewEmpty() const
{
return new XCAFDoc_NoteComment();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_NoteCommentDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const
{
if (!BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable))
return Standard_False;
Handle(XCAFDoc_NoteComment) aNote = Handle(XCAFDoc_NoteComment)::DownCast(theTarget);
if (aNote.IsNull())
return Standard_False;
TCollection_ExtendedString aComment;
if (!(theSource >> aComment))
return Standard_False;
aNote->Set(aComment);
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_NoteCommentDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const
{
BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable);
Handle(XCAFDoc_NoteComment) aNote = Handle(XCAFDoc_NoteComment)::DownCast(theSource);
if (!aNote.IsNull())
theTarget << aNote->Comment();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_NoteCommentDriver::BinMXCAFDoc_NoteCommentDriver(const Handle(Message_Messenger)& theMsgDriver,
Standard_CString theName)
: BinMXCAFDoc_NoteDriver(theMsgDriver, theName)
{
}

View File

@@ -0,0 +1,49 @@
// Created on: 2017-02-13
// Created by: Sergey NIKONOV
// Copyright (c) 2005-2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMXCAFDoc_NoteCommentDriver_HeaderFile
#define _BinMXCAFDoc_NoteCommentDriver_HeaderFile
#include <BinMXCAFDoc_NoteDriver.hxx>
class BinMXCAFDoc_NoteCommentDriver;
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_NoteCommentDriver, BinMXCAFDoc_NoteDriver)
class BinMXCAFDoc_NoteCommentDriver : public BinMXCAFDoc_NoteDriver
{
public:
Standard_EXPORT BinMXCAFDoc_NoteCommentDriver(const Handle(Message_Messenger)& theMsgDriver);
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_NoteCommentDriver, BinMXCAFDoc_NoteDriver)
protected:
BinMXCAFDoc_NoteCommentDriver(const Handle(Message_Messenger)& theMsgDriver,
Standard_CString theName);
};
#endif // _BinMXCAFDoc_NoteCommentDriver_HeaderFile

View File

@@ -22,24 +22,6 @@
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NoteDriver, BinMDF_ADriver)
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_NoteDriver::BinMXCAFDoc_NoteDriver(const Handle(Message_Messenger)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Note)->Name())
{
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_NoteDriver::NewEmpty() const
{
return new XCAFDoc_Note();
}
//=======================================================================
//function :
//purpose :

View File

@@ -35,10 +35,6 @@ class BinMXCAFDoc_NoteDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMXCAFDoc_NoteDriver(const Handle(Message_Messenger)& theMsgDriver);
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;

View File

@@ -39,6 +39,10 @@ BinMXCAFDoc_NoteDriver.cxx
BinMXCAFDoc_NoteDriver.hxx
BinMXCAFDoc_NoteBalloonDriver.cxx
BinMXCAFDoc_NoteBalloonDriver.hxx
BinMXCAFDoc_NoteCommentDriver.cxx
BinMXCAFDoc_NoteCommentDriver.hxx
BinMXCAFDoc_NoteBinDataDriver.cxx
BinMXCAFDoc_NoteBinDataDriver.hxx
BinMXCAFDoc_NotesToolDriver.cxx
BinMXCAFDoc_NotesToolDriver.hxx
BinMXCAFDoc_ShapeToolDriver.cxx
@@ -53,7 +57,3 @@ BinMXCAFDoc_VisMaterialToolDriver.cxx
BinMXCAFDoc_VisMaterialToolDriver.hxx
BinMXCAFDoc_VolumeDriver.cxx
BinMXCAFDoc_VolumeDriver.hxx
BinMXCAFDoc_AnimationDriver.cxx
BinMXCAFDoc_AnimationDriver.hxx
BinMXCAFDoc_AnimationToolDriver.cxx
BinMXCAFDoc_AnimationToolDriver.hxx

View File

@@ -983,21 +983,3 @@ void Bnd_Box::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Gap)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Flags)
}
//=======================================================================
//function : InitFromJson
//purpose :
//=======================================================================
Standard_Boolean Bnd_Box::InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
{
Standard_Integer aPos = theStreamPos;
OCCT_INIT_VECTOR_CLASS (theSStream, "CornerMin", aPos, 3, &Xmin, &Ymin, &Zmin)
OCCT_INIT_VECTOR_CLASS (theSStream, "CornerMax", aPos, 3, &Xmax, &Ymax, &Zmax)
OCCT_INIT_FIELD_VALUE_REAL (theSStream, aPos, Gap);
OCCT_INIT_FIELD_VALUE_INTEGER (theSStream, aPos, Flags);
theStreamPos = aPos;
return Standard_True;
}

View File

@@ -305,9 +305,6 @@ public:
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
//! Inits the content of me into the stream
Standard_EXPORT Standard_Boolean InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos);
protected:
//! Bit flags.

View File

@@ -150,12 +150,12 @@ void CDM_MetaData::UnsetIsReadOnly() {
//function : DumpJson
//purpose :
//=======================================================================
void CDM_MetaData::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
void CDM_MetaData::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRetrieved)
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myDocument)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDocument)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myFolder)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myName)

View File

@@ -17,7 +17,6 @@
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <Message.hxx>
#include <TDocStd_Document.hxx>
#include <TDF_Label.hxx>
#include <TCollection_AsciiString.hxx>
@@ -35,7 +34,6 @@
#include <TDF_ListIteratorOfAttributeDeltaList.hxx>
#include <Standard_DomainError.hxx>
#include <XmlDrivers_MessageReportStorage.hxx>
//=======================================================================
@@ -149,81 +147,11 @@ static Standard_Integer DDocStd_DumpCommand (Draw_Interpretor& di,
}
return 0;
}
std::cerr << "TDocStd_DumpCommand : Error\n";
di << "TDocStd_DumpCommand : Error\n";
return 1;
}
//=======================================================================
//function : DDocStd_ReadMessageReport
//=======================================================================
static Standard_Integer DDocStd_ReadMessageReport (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
if (theArgNb < 2)
{
std::cout << "Error: wrong number of arguments! See usage:\n";
theDI.PrintHelp (theArgVec[0]);
return 1;
}
TCollection_ExtendedString aFileName (theArgVec[1]);
Handle(Message_Report) aReport = Message::DefaultReport (Standard_False);
if (aReport.IsNull())
{
std::cerr << "Error: Message_Report is not created.\n";
return 0;
}
Handle(Message_ReportWriter) aWriter = aReport->MessageWriter();
if (aWriter.IsNull())
{
aWriter = new XmlDrivers_MessageReportStorage();
aWriter->SetFileName (aFileName);
aReport->SetMessageWriter (aWriter);
}
if (!aWriter->ImportReport (aReport))
{
std::cerr << "Error: Message_Report can not be exported in " << aFileName << ".\n";
return 0;
}
return 0;
}
//=======================================================================
//function : DDocStd_WriteMessageReport
//=======================================================================
static Standard_Integer DDocStd_WriteMessageReport (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
if (theArgNb < 2)
{
std::cout << "Error: wrong number of arguments! See usage:\n";
theDI.PrintHelp (theArgVec[0]);
return 1;
}
TCollection_ExtendedString aFileName (theArgVec[1]);
Handle(Message_Report) aReport = Message::DefaultReport (Standard_False);
if (aReport.IsNull())
{
std::cerr << "Error: Message_Report is not created.\n";
return 0;
}
Handle(Message_ReportWriter) aWriter = aReport->MessageWriter();
if (aWriter.IsNull())
{
aWriter = new XmlDrivers_MessageReportStorage();
aWriter->SetFileName (aFileName);
aReport->SetMessageWriter (aWriter);
}
if (!aWriter->ExportReport (aReport))
{
std::cerr << "Error: Message_Report can not be exported in " << aFileName << ".\n";
return 0;
}
return 0;
}
//=======================================================================
//function : ModificationCommands
@@ -246,15 +174,5 @@ void DDocStd::ToolsCommands(Draw_Interpretor& theCommands)
"DumpCommand (DOC)",
__FILE__, DDocStd_DumpCommand, g);
theCommands.Add ("ReadMessageReport",
"ReadMessageReport FileName"
"\nRestores content of the default Message_Report from the file. This file is an XML document."
"\nIt might be restored into report using ReadMessageReport."
__FILE__, DDocStd_ReadMessageReport, g);
theCommands.Add ("WriteMessageReport",
"WriteMessageReport FileName"
"\nStores the default Message_Report into a file. This is an XML document."
"\nIt might be restored into report using ReadMessageReport."
__FILE__, DDocStd_WriteMessageReport, g);
}

View File

@@ -425,7 +425,6 @@ void Draw_Appli(int argc, char** argv, const FDraw_InitAppli Draw_InitAppli)
// standard commands
// *****************************************************************
Draw::BasicCommands(theCommands);
Draw::MessageCommands(theCommands);
Draw::VariableCommands(theCommands);
Draw::UnitCommands(theCommands);
if (!Draw_Batch) Draw::GraphicCommands(theCommands);

View File

@@ -132,9 +132,6 @@ public:
//! Defines Draw basic commands
Standard_EXPORT static void BasicCommands (Draw_Interpretor& I);
//! Defines Draw message commands
Standard_EXPORT static void MessageCommands (Draw_Interpretor& I);
//! Defines Draw variables handling commands.
Standard_EXPORT static void VariableCommands (Draw_Interpretor& I);

View File

@@ -23,7 +23,6 @@
void Draw::Commands (Draw_Interpretor& theCommands)
{
Draw::BasicCommands(theCommands);
Draw::MessageCommands(theCommands);
Draw::VariableCommands(theCommands);
Draw::GraphicCommands(theCommands);
Draw::PloadCommands(theCommands);

View File

@@ -18,6 +18,10 @@
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Bnd_OBB.hxx>
#include <Bnd_Box.hxx>
#include <Draw_Box.hxx>
// This file defines global functions not declared in any public header,
// intended for use from debugger prompt (Command Window in Visual Studio)
@@ -40,3 +44,47 @@ Standard_EXPORT const char* Draw_Eval (const char *theCommandStr)
return anException.GetMessageString();
}
}
//=======================================================================
//function : DBRep_SetOBB
//purpose : Draw OBB
//=======================================================================
Standard_EXPORT const char* Draw_SetOBB(const char* theNameStr, void* theBox)
{
if (theNameStr == 0 || theBox == 0)
{
return "Error: name or box is null";
}
try {
Bnd_OBB B = *(Bnd_OBB*)theBox;
Handle(Draw_Box) DB = new Draw_Box (B, Draw_orange);
Draw::Set (theNameStr, DB);
return theNameStr;
}
catch (Standard_Failure const& anException)
{
return anException.GetMessageString();
}
}
//=======================================================================
//function : DBRep_SetBox
//purpose : Draw Box
//=======================================================================
Standard_EXPORT const char* Draw_SetBox(const char* theNameStr, void* theBox)
{
if (theNameStr == 0 || theBox == 0)
{
return "Error: name or box is null";
}
try {
Bnd_Box B = *(Bnd_Box*)theBox;
Handle(Draw_Box) DB = new Draw_Box (B, Draw_orange);
Draw::Set (theNameStr, DB);
return theNameStr;
}
catch (Standard_Failure const& anException)
{
return anException.GetMessageString();
}
}

View File

@@ -1,266 +0,0 @@
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Draw.hxx>
#include <Draw_Printer.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <Message_PrinterOStream.hxx>
#include <Message_PrinterSystemLog.hxx>
#include <Message_PrinterToReport.hxx>
#include <Message_Report.hxx>
#include <Standard_Dump.hxx>
//==============================================================================
//function : printerType
//purpose :
//==============================================================================
Standard_Boolean printerType (const TCollection_AsciiString& theTypeName,
Handle(Standard_Type)& theType)
{
if (theTypeName == "ostream")
{
theType = STANDARD_TYPE(Message_PrinterOStream);
}
else if (theTypeName == "systemlog")
{
theType = STANDARD_TYPE(Message_PrinterSystemLog);
}
else if (theTypeName == "report")
{
theType = STANDARD_TYPE(Message_PrinterToReport);
}
else if (theTypeName == "draw")
{
theType = STANDARD_TYPE(Draw_Printer);
}
else
return Standard_False;
return Standard_True;
}
//==============================================================================
//function : createPrinter
//purpose :
//==============================================================================
Handle(Message_Printer) createPrinter (const Handle(Standard_Type)& theType, Draw_Interpretor& theDI)
{
const Standard_CString aTypeName = theType->Name();
if (aTypeName == STANDARD_TYPE(Message_PrinterOStream)->Name())
{
return new Message_PrinterOStream();
}
else if (aTypeName == STANDARD_TYPE(Message_PrinterSystemLog)->Name())
{
return new Message_PrinterSystemLog ("draw_messages");
}
else if (aTypeName == STANDARD_TYPE(Message_PrinterToReport)->Name())
{
Handle(Message_PrinterToReport) aMessagePrinter = new Message_PrinterToReport();
const Handle(Message_Report)& aReport = Message::DefaultReport (Standard_True);
aMessagePrinter->SetReport (aReport);
return aMessagePrinter;
}
else if (aTypeName == STANDARD_TYPE(Draw_Printer)->Name())
{
return new Draw_Printer (theDI);
}
return Handle(Message_Printer)();
}
//==============================================================================
//function : SendMessage
//purpose :
//==============================================================================
static Standard_Integer SendMessage (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
if (theArgNb < 2)
{
std::cout << "Error: wrong number of arguments! See usage:\n";
theDI.PrintHelp (theArgVec[0]);
return 1;
}
const Handle(Message_Messenger)& aMessenger = Message::DefaultMessenger();
Handle(Standard_Type) aPrinterType;
for (Standard_Integer anArgIter = 1; anArgIter < theArgNb; ++anArgIter)
{
TCollection_AsciiString anArg (theArgVec[anArgIter]);
anArg.LowerCase();
aMessenger->Send (anArg);
}
return 0;
}
//==============================================================================
//function : DumpMessenger
//purpose :
//==============================================================================
static Standard_Integer DumpMessenger (Draw_Interpretor& theDI, Standard_Integer, const char**)
{
Standard_SStream aStream;
const Handle(Message_Messenger)& aMessenger = Message::DefaultMessenger();
aMessenger->DumpJson (aStream);
theDI << "Message_Messenger\n";
theDI << Standard_Dump::FormatJson (aStream);
return 0;
}
//==============================================================================
//function : SetMessagePrinter
//purpose :
//==============================================================================
static Standard_Integer SetMessagePrinter (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
if (theArgNb < 2)
{
std::cout << "Error: wrong number of arguments! See usage:\n";
theDI.PrintHelp (theArgVec[0]);
return 1;
}
const Handle(Message_Messenger)& aMessenger = Message::DefaultMessenger();
Handle(Standard_Type) aPrinterType;
for (Standard_Integer anArgIter = 1; anArgIter < theArgNb; ++anArgIter)
{
TCollection_AsciiString anArg (theArgVec[anArgIter]);
anArg.LowerCase();
if (anArg == "-clear")
{
aMessenger->ChangePrinters().Clear();
}
else if (anArg == "-type"
&& anArgIter + 1 < theArgNb)
{
TCollection_AsciiString aVal (theArgVec[++anArgIter]);
if (!printerType (aVal, aPrinterType))
{
std::cout << "Syntax error: unknown printer type '" << aVal << "'\n";
return 1;
}
if (aMessenger->HasPrinter (aPrinterType))
continue;
aMessenger->AddPrinter (createPrinter (aPrinterType, theDI));
}
else
{
std::cout << "Syntax error: unknown argument '" << theArgVec[anArgIter] << "'\n";
return 1;
}
}
return 0;
}
//==============================================================================
//function : SetReportMetric
//purpose :
//==============================================================================
static Standard_Integer SetReportMetric(Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
if (theArgNb < 1)
{
std::cout << "Error: wrong number of arguments! See usage:\n";
theDI.PrintHelp (theArgVec[0]);
return 1;
}
const Handle(Message_Report)& aReport = Message::DefaultReport (Standard_True);
if (aReport.IsNull())
return 1;
aReport->ClearMetrics();
for (int i = 1; i < theArgNb; i++)
{
Standard_Integer aMetricId = Draw::Atoi (theArgVec[i]);
if (aMetricId < Message_MetricType_UserTimeCPU || aMetricId > Message_MetricType_MemHeapUsage)
{
std::cout << "Unrecognized message metric: " << aMetricId << std::endl;
return 1;
}
aReport->SetActiveMetric ((Message_MetricType)aMetricId, Standard_True);
}
return 0;
}
//==============================================================================
//function : PrintReport
//purpose :
//==============================================================================
static Standard_Integer PrintReport(Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
if (theArgNb < 1)
{
std::cout << "Error: wrong number of arguments! See usage:\n";
theDI.PrintHelp (theArgVec[0]);
return 1;
}
const Handle(Message_Report)& aReport = Message::DefaultReport (Standard_True);
if (aReport.IsNull())
return 1;
if (theArgNb > 1) // default messenger
{
aReport->SendMessages (Message::DefaultMessenger());
}
else // stream
{
Standard_SStream aSStream;
aReport->Dump (aSStream);
theDI << aSStream;
}
return 0;
}
void Draw::MessageCommands(Draw_Interpretor& theCommands)
{
static Standard_Boolean Done = Standard_False;
if (Done) return;
Done = Standard_True;
std::ios::sync_with_stdio();
const char* group = "DRAW Message Commands";
theCommands.Add("SetMessagePrinter",
"SetMessagePrinter [-type ostream|systemlog|report|draw] [-clear]"
"\n\t\t: Sets printer into messenger or remove all printers."
"\n : Option -type set type of printer. Printers are applyed with And combination."
"\n : Option -clear remove all printers in messenger",
__FILE__, SetMessagePrinter, group);
theCommands.Add("DumpMessenger",
"DumpMessenger"
"\n Prints DumpJson information about Messenger.\n",
__FILE__, DumpMessenger, group);
theCommands.Add("SendMessage",
"SendMessage text [text ...]"
"\n Sends the text into the messenger.\n",
__FILE__, SendMessage, group);
theCommands.Add("SetReportMetric", "SetReportMetric [metric...] \n Activate report metrics, deactivate all if there are no parameters.\n",
__FILE__, SetReportMetric, group);
theCommands.Add("PrintReport", "PrintReport [messenger] \n Send report content to default messenger or stream (if parameter is absent).\n",
__FILE__, PrintReport, group);
}

View File

@@ -15,7 +15,6 @@
#include <Draw_Printer.hxx>
#include <Standard_Dump.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
@@ -45,12 +44,3 @@ void Draw_Printer::send (const TCollection_AsciiString& theString,
*myTcl << theString << "\n";
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Draw_Printer::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
}

View File

@@ -32,8 +32,6 @@ public:
//! Creates a printer connected to the interpretor.
Standard_EXPORT Draw_Printer (Draw_Interpretor& theTcl);
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
protected:
//! Send a string message with specified trace level.

View File

@@ -43,7 +43,6 @@ Draw_Marker2D.hxx
Draw_Marker3D.cxx
Draw_Marker3D.hxx
Draw_MarkerShape.hxx
Draw_MessageCommands.cxx
Draw_Number.cxx
Draw_Number.hxx
Draw_PInterp.hxx

View File

@@ -1,27 +0,0 @@
// Created on: 1991-02-26
// Created by: Isabelle GRIGNON
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Extrema_ExtAlgo_HeaderFile
#define _Extrema_ExtAlgo_HeaderFile
enum Extrema_ExtAlgo
{
Extrema_ExtAlgo_Grad,
Extrema_ExtAlgo_Tree
};
#endif // _Extrema_ExtAlgo_HeaderFile

View File

@@ -17,12 +17,16 @@
#ifndef _Extrema_ExtFlag_HeaderFile
#define _Extrema_ExtFlag_HeaderFile
//! Enumeration describes the objective for extrema algorithms.
//! Generally:
//! - *Extrema_ExtFlag_MIN* - means that only minimal solutions are required
//! - *Extrema_ExtFlag_MAX* - means that only maximal solutions are required
//! - *Extrema_ExtFlag_MINMAX* - means that all solutions are required
enum Extrema_ExtFlag
{
Extrema_ExtFlag_MIN,
Extrema_ExtFlag_MAX,
Extrema_ExtFlag_MINMAX
Extrema_ExtFlag_MIN,
Extrema_ExtFlag_MAX,
Extrema_ExtFlag_MINMAX
};
#endif // _Extrema_ExtFlag_HeaderFile

View File

@@ -144,7 +144,7 @@ void Extrema_ExtPExtS::MakePreciser (Standard_Real& U,
}
//=============================================================================
Extrema_ExtPExtS::Extrema_ExtPExtS()
Extrema_ExtPExtS::Extrema_ExtPExtS (const Handle (Extrema_GenExtPS)& theExtPS)
: myuinf(0.0),
myusup(0.0),
mytolu(0.0),
@@ -153,7 +153,8 @@ Extrema_ExtPExtS::Extrema_ExtPExtS()
mytolv(0.0),
myIsAnalyticallyComputable(Standard_False),
myDone(Standard_False),
myNbExt(0)
myNbExt(0),
myExtPS (theExtPS)
{
}
@@ -166,7 +167,8 @@ Extrema_ExtPExtS::Extrema_ExtPExtS (const gp_Pnt&
const Standard_Real theVmin,
const Standard_Real theVsup,
const Standard_Real theTolU,
const Standard_Real theTolV)
const Standard_Real theTolV,
const Handle(Extrema_GenExtPS)& theExtPS)
: myuinf(theUmin),
myusup(theUsup),
mytolu(theTolU),
@@ -176,7 +178,8 @@ Extrema_ExtPExtS::Extrema_ExtPExtS (const gp_Pnt&
myS (theS),
myIsAnalyticallyComputable(Standard_False),
myDone(Standard_False),
myNbExt(0)
myNbExt(0),
myExtPS (theExtPS)
{
Initialize (theS,
theUmin,
@@ -193,7 +196,8 @@ Extrema_ExtPExtS::Extrema_ExtPExtS (const gp_Pnt&
Extrema_ExtPExtS::Extrema_ExtPExtS (const gp_Pnt& theP,
const Handle(GeomAdaptor_HSurfaceOfLinearExtrusion)& theS,
const Standard_Real theTolU,
const Standard_Real theTolV)
const Standard_Real theTolV,
const Handle(Extrema_GenExtPS)& theExtPS)
: myuinf(theS->FirstUParameter()),
myusup(theS->LastUParameter()),
mytolu(theTolU),
@@ -203,7 +207,8 @@ Extrema_ExtPExtS::Extrema_ExtPExtS (const gp_Pnt&
myS (theS),
myIsAnalyticallyComputable(Standard_False),
myDone(Standard_False),
myNbExt(0)
myNbExt(0),
myExtPS (theExtPS)
{
Initialize (theS,
theS->FirstUParameter(),
@@ -253,15 +258,18 @@ void Extrema_ExtPExtS::Initialize (const Handle(GeomAdaptor_HSurfaceOfLinearExtr
if (!myIsAnalyticallyComputable)
{
myExtPS.Initialize (theS->ChangeSurface(),
32,
32,
theUinf,
theUsup,
theVinf,
theVsup,
theTolU,
theTolV);
if (myExtPS.IsNull())
myExtPS = new Extrema_GenExtPS();
myExtPS->Initialize (theS->ChangeSurface(),
32,
32,
theUinf,
theUsup,
theVinf,
theVsup,
theTolU,
theTolV);
}
}
@@ -280,11 +288,9 @@ void Extrema_ExtPExtS::Perform (const gp_Pnt& P)
myNbExt = 0;
if (!myIsAnalyticallyComputable) {
myExtPS.Perform(P);
myDone = myExtPS.IsDone();
// modified by NIZHNY-EAP Wed Nov 17 12:59:08 1999 ___BEGIN___
myNbExt = myExtPS.NbExt();
// modified by NIZHNY-EAP Wed Nov 17 12:59:09 1999 ___END___
myExtPS->Perform(P);
myDone = myExtPS->IsDone();
myNbExt = myExtPS->NbExt();
return;
}
@@ -443,10 +449,8 @@ Standard_Boolean Extrema_ExtPExtS::IsDone () const { return myDone; }
Standard_Integer Extrema_ExtPExtS::NbExt () const
{
if (!IsDone()) { throw StdFail_NotDone(); }
if (myIsAnalyticallyComputable)
return myNbExt;
else
return myExtPS.NbExt();
return myNbExt;
}
//=============================================================================
@@ -462,7 +466,7 @@ Standard_Real Extrema_ExtPExtS::SquareDistance (const Standard_Integer N) const
return mySqDist[N-1];
// modified by NIZHNY-MKK Thu Sep 18 14:48:42 2003.END
else
return myExtPS.SquareDistance(N);
return myExtPS->SquareDistance(N);
}
//=============================================================================
@@ -479,7 +483,7 @@ const Extrema_POnSurf& Extrema_ExtPExtS::Point (const Standard_Integer N) const
}
// modified by NIZHNY-MKK Thu Sep 18 14:47:43 2003.END
else
return myExtPS.Point(N);
return myExtPS->Point(N);
}
//=============================================================================

View File

@@ -50,15 +50,21 @@ class Extrema_ExtPExtS : public Standard_Transient
public:
Standard_EXPORT Extrema_ExtPExtS();
//! theExtPS is used to compute the solutions in case
//! it cannot be found analytically.
Standard_EXPORT Extrema_ExtPExtS(const Handle(Extrema_GenExtPS)& theExtPS);
//! It calculates all the distances between a point
//! from gp and a Surface.
Standard_EXPORT Extrema_ExtPExtS(const gp_Pnt& P, const Handle(GeomAdaptor_HSurfaceOfLinearExtrusion)& S, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV);
//! theExtPS is used to compute the solutions in case
//! it cannot be found analytically.
Standard_EXPORT Extrema_ExtPExtS(const gp_Pnt& P, const Handle(GeomAdaptor_HSurfaceOfLinearExtrusion)& S, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV, const Handle(Extrema_GenExtPS)& theExtPS = NULL);
//! It calculates all the distances between a point
//! from gp and a Surface.
Standard_EXPORT Extrema_ExtPExtS(const gp_Pnt& P, const Handle(GeomAdaptor_HSurfaceOfLinearExtrusion)& S, const Standard_Real TolU, const Standard_Real TolV);
//! theExtPS is used to compute the solutions in case
//! it cannot be found analytically.
Standard_EXPORT Extrema_ExtPExtS(const gp_Pnt& P, const Handle(GeomAdaptor_HSurfaceOfLinearExtrusion)& S, const Standard_Real TolU, const Standard_Real TolV, const Handle(Extrema_GenExtPS)& theExtPS = NULL);
//! Initializes the fields of the algorithm.
Standard_EXPORT void Initialize (const Handle(GeomAdaptor_HSurfaceOfLinearExtrusion)& S, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV);
@@ -103,13 +109,12 @@ private:
Handle(GeomAdaptor_HSurfaceOfLinearExtrusion) myS;
gp_Vec myDirection;
gp_Ax2 myPosition;
Extrema_GenExtPS myExtPS;
Standard_Boolean myIsAnalyticallyComputable;
Standard_Boolean myDone;
Standard_Integer myNbExt;
Standard_Real mySqDist[4];
Extrema_POnSurf myPoint[4];
Handle(Extrema_GenExtPS) myExtPS;
};

View File

@@ -208,7 +208,9 @@ static Standard_Boolean IsExtremum (const Standard_Real U, const Standard_Real V
//purpose :
//=======================================================================
Extrema_ExtPRevS::Extrema_ExtPRevS()
Extrema_ExtPRevS::Extrema_ExtPRevS(const Handle(Extrema_GenExtPS)& theExtPS)
:
myExtPS (theExtPS)
{
myvinf = myvsup = 0.0;
mytolv = Precision::Confusion();
@@ -233,7 +235,10 @@ Extrema_ExtPRevS::Extrema_ExtPRevS (const gp_Pnt&
const Standard_Real theVmin,
const Standard_Real theVsup,
const Standard_Real theTolU,
const Standard_Real theTolV)
const Standard_Real theTolV,
const Handle(Extrema_GenExtPS)& theExtPS)
:
myExtPS (theExtPS)
{
Initialize (theS,
theUmin,
@@ -253,7 +258,10 @@ Extrema_ExtPRevS::Extrema_ExtPRevS (const gp_Pnt&
Extrema_ExtPRevS::Extrema_ExtPRevS (const gp_Pnt& theP,
const Handle(GeomAdaptor_HSurfaceOfRevolution)& theS,
const Standard_Real theTolU,
const Standard_Real theTolV)
const Standard_Real theTolV,
const Handle(Extrema_GenExtPS)& theExtPS)
:
myExtPS (theExtPS)
{
Initialize (theS,
theS->FirstUParameter(),
@@ -305,15 +313,18 @@ void Extrema_ExtPRevS::Initialize (const Handle(GeomAdaptor_HSurfaceOfRevolution
aNbv = 100;
}
myExtPS.Initialize (theS->ChangeSurface(),
aNbu,
aNbv,
theUmin,
theUsup,
theVmin,
theVsup,
theTolU,
theTolV);
if (myExtPS.IsNull())
myExtPS = new Extrema_GenExtPS();
myExtPS->Initialize (theS->ChangeSurface(),
aNbu,
aNbv,
theUmin,
theUsup,
theVmin,
theVsup,
theTolU,
theTolV);
}
}
//=======================================================================
@@ -326,11 +337,11 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P)
myDone = Standard_False;
myNbExt = 0;
if (!myIsAnalyticallyComputable) {
myExtPS.Perform(P);
myDone = myExtPS.IsDone();
myNbExt = myExtPS.NbExt();
if (!myIsAnalyticallyComputable)
{
myExtPS->Perform(P);
myDone = myExtPS->IsDone();
myNbExt = myExtPS->NbExt();
return;
}
@@ -555,7 +566,7 @@ Standard_Real Extrema_ExtPRevS::SquareDistance(const Standard_Integer N) const
if (myIsAnalyticallyComputable)
return mySqDist[N-1];
else
return myExtPS.SquareDistance(N);
return myExtPS->SquareDistance(N);
}
//=======================================================================
//function : Point
@@ -571,7 +582,7 @@ const Extrema_POnSurf& Extrema_ExtPRevS::Point(const Standard_Integer N) const
if (myIsAnalyticallyComputable)
return myPoint[N-1];
else
return myExtPS.Point(N);
return myExtPS->Point(N);
}

View File

@@ -45,16 +45,21 @@ class Extrema_ExtPRevS : public Standard_Transient
public:
Standard_EXPORT Extrema_ExtPRevS();
//! theExtPS is used to compute the solutions in case
//! it cannot be found analytically.
Standard_EXPORT Extrema_ExtPRevS(const Handle(Extrema_GenExtPS)& theExtPS = NULL);
//! It calculates all the distances between a point
//! from gp and a SurfacePtr from Adaptor3d.
Standard_EXPORT Extrema_ExtPRevS(const gp_Pnt& P, const Handle(GeomAdaptor_HSurfaceOfRevolution)& S, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV);
//! theExtPS is used to compute the solutions in case
//! it cannot be found analytically.
Standard_EXPORT Extrema_ExtPRevS(const gp_Pnt& P, const Handle(GeomAdaptor_HSurfaceOfRevolution)& S, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV, const Handle(Extrema_GenExtPS)& theExtPS = NULL);
//! It calculates all the distances between a point
//! from gp and a SurfacePtr from Adaptor3d.
Standard_EXPORT Extrema_ExtPRevS(const gp_Pnt& P, const Handle(GeomAdaptor_HSurfaceOfRevolution)& S, const Standard_Real TolU, const Standard_Real TolV);
//! theExtPS is used to compute the solutions in case
//! it cannot be found analytically.
Standard_EXPORT Extrema_ExtPRevS(const gp_Pnt& P, const Handle(GeomAdaptor_HSurfaceOfRevolution)& S, const Standard_Real TolU, const Standard_Real TolV, const Handle(Extrema_GenExtPS)& theExtPS = NULL);
Standard_EXPORT void Initialize (const Handle(GeomAdaptor_HSurfaceOfRevolution)& S, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV);
@@ -90,13 +95,12 @@ private:
Standard_Real myvsup;
Standard_Real mytolv;
gp_Ax2 myPosition;
Extrema_GenExtPS myExtPS;
Standard_Boolean myIsAnalyticallyComputable;
Standard_Boolean myDone;
Standard_Integer myNbExt;
Standard_Real mySqDist[8];
Extrema_POnSurf myPoint[8];
Handle(Extrema_GenExtPS) myExtPS;
};

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