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

Compare commits

..

1 Commits

Author SHA1 Message Date
dorlov
85d8da9c3c 0033338: Coding - IGESToBRep_CurveAndSurface's method has unreachable code
Fixed
2023-07-06 10:46:15 +01:00
9 changed files with 205 additions and 430 deletions

View File

@@ -725,7 +725,7 @@ Another possible problem is the order of initialization of global variables defi
Avoid explicit usage of basic types (*int*, *float*, *double*, etc.), use Open CASCADE Technology types from package *Standard: Standard_Integer, Standard_Real, Standard_ShortReal, Standard_Boolean, Standard_CString* and others or a specific *typedef* instead.
### Use sizeof() to calculate sizes [MANDATORY]
### Use *sizeof()* to calculate sizes [MANDATORY]
Do not assume sizes of types. Use *sizeof()* instead to calculate sizes.
@@ -738,7 +738,7 @@ It is recommended to follow this rule for any plain text files for consistency a
The rules listed in this chapter are important for stability of the programs that use Open CASCADE Technology libraries.
### Use OSD::SetSignal() to catch exceptions
### Use *OSD::SetSignal()* to catch exceptions
When using Open CASCADE Technology in an application, call *OSD::SetSignal()* function when the application is initialized.
@@ -787,7 +787,7 @@ See the following example:
In C++ use *new* and *delete* operators instead of *malloc()* and *free()*. Try not to mix different memory allocation techniques.
### Match new and delete [MANDATORY]
### Match *new* and *delete* [MANDATORY]
Use the same form of new and delete.
@@ -812,7 +812,7 @@ Standard_Integer aTmpVar2 = 0; // OK
Uninitialized variables might be kept only within performance-sensitive code blocks and only when their initialization is guaranteed by subsequent code.
### Do not hide global new
### Do not hide global *new*
Avoid hiding the global *new* operator.

View File

@@ -780,7 +780,7 @@ restore theBox
@subsubsection occt_draw_3_3_1 set
#### In DrawTrSurf package:
#### In *DrawTrSurf* package:
~~~~{.php}
void Set(Standard_CString& Name,const gp_Pnt& G) ;
@@ -797,7 +797,7 @@ void Set(Standard_CString& Name,
const Handle(Poly_Polygon2D)& P) ;
~~~~
#### In DBRep package:
#### In *DBRep* package:
~~~~{.php}
void Set(const Standard_CString Name,
@@ -822,13 +822,13 @@ DBRep::Set(char*,B);
@subsubsection occt_draw_3_3_2 get
#### In DrawTrSurf package:
#### In *DrawTrSurf* package:
~~~~{.php}
Handle_Geom_Geometry Get(Standard_CString& Name) ;
~~~~
#### In DBRep package:
#### In *DBRep* package:
~~~~{.php}
TopoDS_Shape Get(Standard_CString& Name,

View File

@@ -1047,13 +1047,11 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
: 0.0;
if (double (Abs (aDelta.x())) > aZoomTol)
{
UpdateZoom (Aspect_ScrollDelta (aDelta.x()));
myUI.Dragging.ToMove = true;
myUI.Dragging.PointTo = thePoint;
if (UpdateZoom (Aspect_ScrollDelta (aDelta.x())))
{
toUpdateView = true;
}
myMouseProgressPoint = thePoint;
toUpdateView = true;
}
break;
}
@@ -1077,6 +1075,7 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
}
aDelta.y() = -aDelta.y();
myMouseProgressPoint = thePoint;
if (myUI.Panning.ToPan)
{
myUI.Panning.Delta += aDelta;
@@ -1086,12 +1085,6 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
myUI.Panning.ToPan = true;
myUI.Panning.Delta = aDelta;
}
myUI.Dragging.ToMove = true;
myUI.Dragging.PointTo = thePoint;
myMouseProgressPoint = thePoint;
toUpdateView = true;
}
break;
@@ -3060,8 +3053,6 @@ void AIS_ViewController::handleDynamicHighlight (const Handle(AIS_InteractiveCon
OnObjectDragged (theCtx, theView, AIS_DragAction_Update);
myGL.OrbitRotation.ToRotate = false;
myGL.ViewRotation .ToRotate = false;
myGL.Panning .ToPan = false;
myGL.ZoomActions.Clear();
}
}
}

View File

@@ -217,10 +217,6 @@ Method:
Then, (1) <=> (A*Cos-X,B*Sin-Y).(-A*Sin,B*Cos) = 0.
(B**2-A**2)*Cos*Sin - B*Y*Cos + A*X*Sin = 0.
Use algorithm math_TrigonometricFunctionRoots to solve this equation.
Addition:
In case, when MajorRadius == MinorRadius calcualtion errors may occur
This case should be processed as Circle
-----------------------------------------------------------------------------*/
{
myDone = Standard_False;
@@ -233,53 +229,6 @@ Method:
gp_Vec Trsl = Axe.Multiplied(-(gp_Vec(O,P).Dot(Axe)));
gp_Pnt Pp = P.Translated(Trsl);
if (Abs(C.MajorRadius() - C.MinorRadius() < Precision::Confusion()))
{
gp_Vec OPp(O, Pp);
if (OPp.Magnitude() < Tol) { return; }
Standard_Real Usol[2];
Usol[0] = C.XAxis().Direction().AngleWithRef(OPp, Axe); // -M_PI<U1<M_PI
const Standard_Real aAngTol = Precision::Angular();
if (Usol[0] + M_PI < aAngTol)
Usol[0] = -M_PI;
else if (Usol[0] - M_PI > -aAngTol)
Usol[0] = M_PI;
Usol[1] = Usol[0] + M_PI;
Standard_Real myuinf = Uinf;
Standard_Real TolU, aR;
aR = C.MajorRadius();
TolU = Precision::Infinite();
if (aR > gp::Resolution()) {
TolU = Tol / aR;
}
//
ElCLib::AdjustPeriodic(Uinf, Uinf + 2 * M_PI, TolU, myuinf, Usol[0]);
ElCLib::AdjustPeriodic(Uinf, Uinf + 2 * M_PI, TolU, myuinf, Usol[1]);
if (((Usol[0] - 2 * M_PI - Uinf) < TolU) && ((Usol[0] - 2 * M_PI - Uinf) > -TolU)) Usol[0] = Uinf;
if (((Usol[1] - 2 * M_PI - Uinf) < TolU) && ((Usol[1] - 2 * M_PI - Uinf) > -TolU)) Usol[1] = Uinf;
// 3- Calculate extrema in [Umin,Umax] ...
gp_Pnt Cu;
Standard_Real Us;
for (Standard_Integer NoSol = 0; NoSol <= 1; NoSol++) {
Us = Usol[NoSol];
if (((Uinf - Us) < TolU) && ((Us - Usup) < TolU)) {
Cu = ElCLib::Value(Us, C);
mySqDist[myNbExt] = Cu.SquareDistance(P);
myIsMin[myNbExt] = (NoSol == 0);
myPoint[myNbExt] = Extrema_POnCurv(Us, Cu);
myNbExt++;
}
}
myDone = Standard_True;
return;
}
// 2- Calculation of solutions ...
Standard_Integer NoSol, NbSol;

View File

@@ -226,303 +226,269 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferCurveAndSurface
//function : TransferGeometry
//purpose :
//=======================================================================
TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
(const Handle(IGESData_IGESEntity)& start,
(const Handle(IGESData_IGESEntity)& theStart,
const Message_ProgressRange& theProgress)
{
// Declaration of messages//
// DCE 22/12/98
//Message_Msg msg1005("IGES_1005"); // Software error : start IsNull.
//Message_Msg msg1015("IGES_1015"); // invalid type or exception raising (software error).
//Message_Msg msg1010("IGES_1010"); // Not sameparameter.
// Message_Msg msg1015("IGES_1015");
//Message_Msg msg210 ("XSTEP_210");
//Message_Msg msg202 ("XSTEP_202");
//Message_Msg aMsg1005("IGES_1001"); // The type of the Start is not recognized
//Message_Msg aMsg1005("IGES_1005"); // Software error : the Start IsNull.
//Message_Msg aMsg1015("IGES_1015"); // invalid type or exception raising (software error).
//Message_Msg aMsg1010("IGES_1010"); // Not sameparameter.
//Message_Msg aMsg1015("IGES_1020"); // Associated entity IsNull
//Message_Msg aMsg1015("IGES_1025"); // No shape is found for the associated entity for the type 308
//Message_Msg aMsg1015("IGES_1030"); // No shape is found for the associated entity for the type 402
//Message_Msg aMsg1015("IGES_1035"); // The conversion of a Location is not possible
//Message_Msg aMsg210 ("XSTEP_210"); // No associated entities for the type 308
//Message_Msg aMsg202 ("XSTEP_202"); // No associated entities for the type 402
////////////////////////////
TopoDS_Shape res;
gp_Trsf T408;
if (start.IsNull()) {
if (theStart.IsNull())
{
Message_Msg msg1005("IGES_1005"); // Software error : start IsNull.
SendFail(start, msg1005);
SendFail(theStart, msg1005);
return res;
}
// Read of the DE number and the type number of the entity
Handle(TCollection_HAsciiString) label = GetModel()->StringLabel(start);
//Standard_Integer typeNumber = start->TypeNumber();
// sln 13.06.2002 OCC448: Avoid transferring invisible sub entities which
// logically depend on the one
Standard_Integer onlyvisible = Interface_Static::IVal("read.iges.onlyvisible");
if (IGESToBRep::IsCurveAndSurface(start)) {
if(onlyvisible && start->BlankStatus() == 1)
const Standard_Integer anOnlyvisible = Interface_Static::IVal("read.iges.onlyvisible");
if (IGESToBRep::IsCurveAndSurface(theStart))
{
if(anOnlyvisible && theStart->BlankStatus() == 1)
return res;
try {
try
{
OCC_CATCH_SIGNALS
res = TransferCurveAndSurface(start, theProgress);
res = TransferCurveAndSurface(theStart, theProgress);
}
catch(Standard_Failure const&) {
catch(Standard_Failure const&)
{
Message_Msg msg1015("IGES_1015");
SendFail(start, msg1015);
SendFail(theStart, msg1015);
}
return res;
}
//408 : SingularSubfigure
if (start->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure)))
if (theStart->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure)))
{
if(onlyvisible && start->BlankStatus() == 1)
if(anOnlyvisible && theStart->BlankStatus() == 1)
return res;
DeclareAndCast(IGESBasic_SingularSubfigure, st408, start);
DeclareAndCast(IGESBasic_SingularSubfigure, st408, theStart);
Handle (IGESBasic_SubfigureDef) stsub = st408->Subfigure();
gp_XYZ trans = st408->Translation();
const gp_XYZ trans = st408->Translation();
gp_Vec vectr(trans);
Standard_Real scunit = GetUnitFactor();
const Standard_Real scunit = GetUnitFactor();
vectr.Multiply(scunit);
T408.SetTranslation(vectr);
if (st408->HasScaleFactor()) {
Standard_Real scalef = st408->ScaleFactor();
T408.SetScaleFactor(scalef);
}
if (HasShapeResult(stsub)) {
res = GetShapeResult(stsub);
if (st408->HasScaleFactor())
{
const Standard_Real scalef = st408->ScaleFactor();
T408.SetScaleFactor(scalef);
}
else {
try {
OCC_CATCH_SIGNALS
res = TransferGeometry(stsub, theProgress);
}
catch(Standard_Failure const&) {
res.Nullify();
Message_Msg msg1015("IGES_1015");
SendFail( st408, msg1015);
}
if (!res.IsNull()) {
SetShapeResult(stsub,res);
}
if (HasShapeResult(stsub))
{
res = GetShapeResult(stsub);
}
else
{
try
{
OCC_CATCH_SIGNALS
res = TransferGeometry(stsub, theProgress);
}
catch(Standard_Failure const&)
{
res.Nullify();
const Message_Msg msg1015("IGES_1015");
SendFail(st408, msg1015);
}
if (!res.IsNull())
{
SetShapeResult(stsub, res);
}
}
}
// 308 : SubfigureDefinition
else if (start->IsKind(STANDARD_TYPE(IGESBasic_SubfigureDef))) {
DeclareAndCast(IGESBasic_SubfigureDef, st308, start);
TopoDS_Compound group;
BRep_Builder B;
B.MakeCompound (group);
if (st308->NbEntities() < 1) {
Message_Msg msg210 ("XSTEP_210");
SendFail( st308, msg210);
else if (theStart->IsKind(STANDARD_TYPE(IGESBasic_SubfigureDef)))
{
DeclareAndCast(IGESBasic_SubfigureDef, st308, theStart);
TopoDS_Compound aGroup;
BRep_Builder aBuilder;
aBuilder.MakeCompound (aGroup);
if (st308->NbEntities() < 1)
{
const Message_Msg msg210 ("XSTEP_210");
SendFail(st308, msg210);
return res;
}
Message_ProgressScope PS (theProgress, "Subfigure item", st308->NbEntities());
for (Standard_Integer i=1; i <= st308->NbEntities() && PS.More(); i++)
Message_ProgressScope aPS (theProgress, "Subfigure item", st308->NbEntities());
for (Standard_Integer anIndx =1; anIndx <= st308->NbEntities() && aPS.More(); anIndx++)
{
Message_ProgressRange aRange = PS.Next();
TopoDS_Shape item;
if (st308->AssociatedEntity(i).IsNull()) {
Message_Msg msg1020("IGES_1020");
msg1020.Arg(i);
SendWarning( st308, msg1020);
continue;
Message_ProgressRange aRange = aPS.Next();
TopoDS_Shape anItem;
if (st308->AssociatedEntity(anIndx).IsNull())
{
Message_Msg msg1020("IGES_1020");
msg1020.Arg(anIndx);
SendWarning(st308, msg1020);
continue;
}
if(onlyvisible && st308->AssociatedEntity(i)->BlankStatus() == 1 )
continue;
if (HasShapeResult(st308->AssociatedEntity(i)))
{
item = GetShapeResult(st308->AssociatedEntity(i));
}
else {
try {
OCC_CATCH_SIGNALS
item = TransferGeometry (st308->AssociatedEntity(i), aRange);
}
catch(Standard_Failure const&) {
item.Nullify();
Message_Msg msg1015("IGES_1015");
SendFail( st308->AssociatedEntity(i), msg1015);
}
if(anOnlyvisible && st308->AssociatedEntity(anIndx)->BlankStatus() == 1)
continue;
if (HasShapeResult(st308->AssociatedEntity(anIndx)))
{
anItem = GetShapeResult(st308->AssociatedEntity(anIndx));
}
if (item.IsNull()) {
Message_Msg msg1025("IGES_1025");
msg1025.Arg(i);
SendWarning (start,msg1025);
else
{
try
{
OCC_CATCH_SIGNALS
anItem = TransferGeometry (st308->AssociatedEntity(anIndx), aRange);
}
catch(Standard_Failure const&)
{
anItem.Nullify();
const Message_Msg msg1015("IGES_1015");
SendFail(st308->AssociatedEntity(anIndx), msg1015);
}
}
else {
B.Add(group, item);
SetShapeResult (st308->AssociatedEntity(i),item);
if (anItem.IsNull())
{
Message_Msg msg1025("IGES_1025");
msg1025.Arg(anIndx);
SendWarning (theStart, msg1025);
}
else
{
aBuilder.Add(aGroup, anItem);
SetShapeResult (st308->AssociatedEntity(anIndx), anItem);
}
}
res = group;
res = aGroup;
}
else if (start->IsKind(STANDARD_TYPE(IGESBasic_Group))) {
if(onlyvisible && start->BlankStatus() == 1)
return res;
DeclareAndCast(IGESBasic_Group, st402f1, start);
TopoDS_Compound group;
BRep_Builder B;
B.MakeCompound (group);
if (st402f1->NbEntities() < 1) {
// 402 : Group Associativity
else if (theStart->IsKind(STANDARD_TYPE(IGESBasic_Group)))
{
if(anOnlyvisible && theStart->BlankStatus() == 1)
return res;
DeclareAndCast(IGESBasic_Group, st402f1, theStart);
TopoDS_Compound aGroup;
BRep_Builder aBuilder;
aBuilder.MakeCompound (aGroup);
const Standard_Integer aNbEnt = st402f1->NbEntities();
if (aNbEnt < 1)
{
Message_Msg msg202 ("XSTEP_202");
msg202.Arg(st402f1->FormNumber());
SendFail(st402f1, msg202);
return res;
}
Message_ProgressScope PS (theProgress, "Group item", st402f1->NbEntities());
Message_ProgressScope aPS (theProgress, "Group item", aNbEnt);
Standard_Boolean ProblemInGroup = Standard_False;
for (Standard_Integer i=1; i <= st402f1->NbEntities() && PS.More(); i++)
for (Standard_Integer anIndx=1; anIndx <= aNbEnt && aPS.More(); anIndx++)
{
Message_ProgressRange aRange = PS.Next();
TopoDS_Shape item;
if (st402f1->Entity(i).IsNull()) {
Message_Msg msg1020("IGES_1020");
msg1020.Arg(i);
SendFail( st402f1, msg1020);
continue;
Message_ProgressRange aRange = aPS.Next();
TopoDS_Shape anItem;
if (st402f1->Entity(anIndx).IsNull())
{
Message_Msg msg1020("IGES_1020");
msg1020.Arg(anIndx);
SendFail(st402f1, msg1020);
continue;
}
if(onlyvisible && st402f1->Entity(i)->BlankStatus() == 1)
continue;
if (HasShapeResult(st402f1->Entity(i))) {
item = GetShapeResult(st402f1->Entity(i));
if(anOnlyvisible && st402f1->Entity(anIndx)->BlankStatus() == 1)
continue;
if (HasShapeResult(st402f1->Entity(anIndx)))
{
anItem = GetShapeResult(st402f1->Entity(anIndx));
}
else {
try {
OCC_CATCH_SIGNALS
item = TransferGeometry (st402f1->Entity(i), aRange);
}
catch(Standard_Failure const&) {
item.Nullify();
Message_Msg msg1015("IGES_1015");
SendFail(st402f1->Entity(i),msg1015);
}
else
{
try
{
OCC_CATCH_SIGNALS
anItem = TransferGeometry (st402f1->Entity(anIndx), aRange);
}
catch(Standard_Failure const&)
{
anItem.Nullify();
Message_Msg msg1015("IGES_1015");
SendFail(st402f1->Entity(anIndx), msg1015);
}
}
if (item.IsNull()) {
//Message_Msg msg1030("IGES_1030");
//msg1030.Arg(st402f1->FormNumber());
//msg1030.Arg(i);
//SendWarning (st402f1,msg1030);
if (anItem.IsNull())
{
ProblemInGroup = Standard_True;
}
else {
B.Add(group, item);
SetShapeResult (st402f1->Entity(i),item);
else
{
aBuilder.Add(aGroup, anItem);
SetShapeResult (st402f1->Entity(anIndx), anItem);
}
}
res = group;
if(ProblemInGroup) {
res = aGroup;
if(ProblemInGroup)
{
Message_Msg msg1030("IGES_1030");
msg1030.Arg(st402f1->FormNumber());
SendWarning (st402f1,msg1030);
SendWarning (st402f1, msg1030);
}
}
else if (start->IsKind(STANDARD_TYPE(IGESBasic_GroupWithoutBackP))) {
if(onlyvisible && start->BlankStatus() == 1)
return res;
DeclareAndCast(IGESBasic_GroupWithoutBackP, st402f7, start);
TopoDS_Compound group;
//unused Handle(TCollection_HAsciiString) label = GetModel()->StringLabel(st402f7);
BRep_Builder B;
B.MakeCompound (group);
if (st402f7->NbEntities() < 1) {
Message_Msg msg202 ("XSTEP_202");
msg202.Arg(st402f7->FormNumber());
SendFail(st402f7, msg202);
return res;
}
Message_ProgressScope PS (theProgress, "Group item", st402f7->NbEntities());
Standard_Boolean ProblemInGroup = Standard_False;
for (Standard_Integer i=1; i <= st402f7->NbEntities() && PS.More(); i++)
{
Message_ProgressRange aRange = PS.Next();
TopoDS_Shape item;
if (st402f7->Entity(i).IsNull()) {
Message_Msg msg1020("IGES_1020");
msg1020.Arg(i);
SendFail( st402f7, msg1020);
continue;
}
if(onlyvisible && st402f7->Entity(i)->BlankStatus() == 1 )
continue;
if (HasShapeResult(st402f7->Entity(i))) {
item = GetShapeResult(st402f7->Entity(i));
}
else {
try {
OCC_CATCH_SIGNALS
item = TransferGeometry (st402f7->Entity(i), aRange);
}
catch(Standard_Failure const&) {
item.Nullify();
Message_Msg msg1015("IGES_1015");
SendFail(st402f7->Entity(i),msg1015);
}
}
if (item.IsNull()) {
//Message_Msg msg1030("IGES_1030");
//msg1030.Arg(st402f7->FormNumber());
//msg1030.Arg(i);
//SendWarning (st402f7,msg1030);
ProblemInGroup = Standard_True;
}
else {
B.Add(group, item);
SetShapeResult (st402f7->Entity(i),item);
}
}
res = group;
if(ProblemInGroup) {
Message_Msg msg1030("IGES_1030");
msg1030.Arg(st402f7->FormNumber());
SendWarning (st402f7,msg1030);
}
}
else {
else
{
Message_Msg msg1001("IGES_1001");
msg1001.Arg(start->FormNumber());
SendFail (start,msg1001);
msg1001.Arg(theStart->FormNumber());
SendFail (theStart, msg1001);
return res;
}
if (start->HasTransf()) {
if (theStart->HasTransf())
{
gp_Trsf T;
SetEpsilon(1.E-04);
if (IGESData_ToolLocation::ConvertLocation(GetEpsilon(),start->CompoundLocation(),
T,GetUnitFactor())) {
if (start->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure)))
{
gp_XYZ tra = T.TranslationPart();
gp_XYZ trans = T408.TranslationPart();
tra.Add(trans);
T.SetTranslationPart(tra);
Standard_Real sc = T.ScaleFactor();
Standard_Real scalef = T408.ScaleFactor();
sc = sc*scalef;
T.SetScaleFactor(sc);
}
if (IGESData_ToolLocation::ConvertLocation(GetEpsilon(), theStart->CompoundLocation(),
T, GetUnitFactor()))
{
if (theStart->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure)))
{
gp_XYZ tra = T.TranslationPart();
const gp_XYZ trans = T408.TranslationPart();
tra.Add(trans);
T.SetTranslationPart(tra);
Standard_Real sc = T.ScaleFactor();
const Standard_Real scalef = T408.ScaleFactor();
sc = sc*scalef;
T.SetScaleFactor(sc);
}
TopLoc_Location L(T);
res.Move(L, Standard_False);
}
else {
else
{
Message_Msg msg1035("IGES_1035");
SendWarning (start,msg1035);
SendWarning (theStart, msg1035);
}
}
else {
if (start->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure))) {
else
{
if (theStart->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure)))
{
TopLoc_Location L(T408);
res.Move(L);
res.Move(L);
}
}
}
return res;
}

View File

@@ -13910,73 +13910,6 @@ static int VSelBvhBuild (Draw_Interpretor& /*theDI*/, Standard_Integer theNbArgs
return 0;
}
//=======================================================================
//function : VChangeMouseGesture
//purpose :
//=======================================================================
static int VChangeMouseGesture (Draw_Interpretor&,
Standard_Integer theArgsNb,
const char** theArgVec)
{
Handle(V3d_View) aView = ViewerTest::CurrentView();
if (aView.IsNull())
{
Message::SendFail ("Error: no active viewer");
return 1;
}
NCollection_DoubleMap<TCollection_AsciiString, AIS_MouseGesture> aGestureMap;
{
aGestureMap.Bind ("none", AIS_MouseGesture_NONE);
aGestureMap.Bind ("selectrectangle", AIS_MouseGesture_SelectRectangle);
aGestureMap.Bind ("selectlasso", AIS_MouseGesture_SelectLasso);
aGestureMap.Bind ("zoom", AIS_MouseGesture_Zoom);
aGestureMap.Bind ("zoomwindow", AIS_MouseGesture_ZoomWindow);
aGestureMap.Bind ("pan", AIS_MouseGesture_Pan);
aGestureMap.Bind ("rotateorbit", AIS_MouseGesture_RotateOrbit);
aGestureMap.Bind ("rotateview", AIS_MouseGesture_RotateView);
aGestureMap.Bind ("drag", AIS_MouseGesture_Drag);
}
NCollection_DoubleMap<TCollection_AsciiString, Standard_UInteger> aMouseButtonMap;
{
aMouseButtonMap.Bind ("none", (Standard_UInteger )Aspect_VKeyMouse_NONE);
aMouseButtonMap.Bind ("left", (Standard_UInteger )Aspect_VKeyMouse_LeftButton);
aMouseButtonMap.Bind ("middle", (Standard_UInteger )Aspect_VKeyMouse_MiddleButton);
aMouseButtonMap.Bind ("right", (Standard_UInteger )Aspect_VKeyMouse_RightButton);
}
Standard_UInteger aButton = (Standard_UInteger )Aspect_VKeyMouse_LeftButton;
AIS_MouseGesture aGesture = AIS_MouseGesture_RotateOrbit;
for (Standard_Integer anArgIter = 1; anArgIter < theArgsNb; ++anArgIter)
{
Standard_CString anArg = theArgVec[anArgIter];
TCollection_AsciiString anArgCase (anArg);
anArgCase.LowerCase();
if (anArgCase == "-button")
{
TCollection_AsciiString aButtonStr = theArgVec[++anArgIter];
aButtonStr.LowerCase();
aButton = aMouseButtonMap.Find1 (aButtonStr);
}
else if (anArgCase == "-gesture")
{
TCollection_AsciiString aGestureStr = theArgVec[++anArgIter];
aGestureStr.LowerCase();
aGesture = aGestureMap.Find1 (aGestureStr);
}
else
{
Message::SendFail() << "Error: unknown argument '" << anArg << "'";
return 1;
}
}
Handle(ViewerTest_EventManager) aViewMgr = ViewerTest::CurrentEventManager();
aViewMgr->ChangeMouseGestureMap().Bind (aButton, aGesture);
return 0;
}
//=======================================================================
//function : ViewerTest_ExitProc
//purpose :
@@ -14994,12 +14927,4 @@ Turns on/off prebuilding of BVH within background thread(s).
-nbThreads number of threads, 1 by default; if < 1 then used (NbLogicalProcessors - 1);
-wait waits for building all of BVH.
)" /* [vselbvhbuild] */);
addCmd ("vchangemousegesture", VChangeMouseGesture, /* [vchangemousegesture] */ R"(
vchangemousegesture -button {none|left|middle|right}=left
-gesture {none|selectRectangle|selectLasso|zoom|zoomWindow|pan|rotateOrbit|rotateView|drag}=rotateOrbit
Changes the gesture for the mouse button.
-button the mouse button;
-gesture the new gesture for the button.
)" /* [vchangemousegesture] */);
}

View File

@@ -2,8 +2,8 @@ puts "========================"
puts "0033414: Modeling Algorithms - Access violation during executing BRepAlgoAPI_Section::Build()"
puts "========================"
set filepath1 [locate_data_file "bug33414_1.brep"]
set filepath2 [locate_data_file "bug33414_2.brep"]
set filepath1 [locate_data_file "CR33414_1.brep"]
set filepath2 [locate_data_file "CR33414_2.brep"]
restore ${filepath1} shape1
restore ${filepath2} shape2
bsection res shape1 shape2

View File

@@ -1,13 +0,0 @@
puts "================================================================="
puts "0033418: Modeling Algorithms - BRepExtrema_DistShapeShape wrong arc ellipse - point result"
puts "================================================================="
puts ""
ellipse el 0 0 0 0 1 0 1 1
trim el el 4.71238898038 1.57079632679
mkedge el el
vertex v 0 0 1.5
distmini d el v
if {[dval d_val] > 0.5000001} {
puts "ERROR: Wrong distance calculation"
}

View File

@@ -1,43 +0,0 @@
puts "=============================================="
puts "0032879: Visualization - Separate pan/zoom and move the object behavior in AIS_ViewController"
puts "=============================================="
puts ""
pload MODELING VISUALIZATION
vinit View1
pcylinder c1 5 10
vdisplay c1
vsetdispmode 1
vmanipulator m -attach c1 -adjustPosition 1 -adjustSize 0 -enableModes 1 -size 40
vfit
# note: mouse events cannot be emulated here, so the original bug cannot be reproduced by this test case
# pan for the left mouse button
vchangemousegesture -button left -gesture pan
set mouse_pick {204 194}
set mouse_drag {369 35}
vmoveto {*}$mouse_pick
vselect {*}$mouse_pick
vmanipulator m -startTransform {*}$mouse_pick
vmanipulator m -transform {*}$mouse_drag
vmanipulator m -stopTransform
vselect 0 0
vdump $imagedir/${casename}_pan.png
# zoom for the left mouse button
vchangemousegesture -button left -gesture zoom
set mouse_pick {206 32}
set mouse_drag {365 330}
vmoveto {*}$mouse_pick
vselect {*}$mouse_pick
vmanipulator m -startTransform {*}$mouse_pick
vmanipulator m -transform {*}$mouse_drag
vmanipulator m -stopTransform
vselect 0 0
vdump $imagedir/${casename}_zoom.png