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

Compare commits

...

7 Commits

Author SHA1 Message Date
dpasukhi
656b0d217f 0033557: Coding - Cocoa compilation problem
Fixed extern relation for VisTest component on MacOS
2023-12-26 08:37:59 +00:00
dpasukhi
83bb2a329d 0033555: Foundation Classes - DEBUG macro leads to compile error
Removed incorrect parameter call when DEBUG macro is active
2023-12-15 19:53:17 +00:00
dpasukhi
5b0f5b52b9 0033554: Foundation Classes - Missed hash specialization for enumerations
Fixed problem with missed hash specialization
2023-12-15 19:53:06 +00:00
dpasukhi
06282d9c7c 0033553: Foundation Classes - HashUtils compilation problem
Updated OptimalSeed template
2023-12-15 19:52:56 +00:00
Xu Zhongxing
60792f26f0 0033552: Foundation Classes - NCollection_BaseMap move ctor clears wrong pointer
Replaced correct class member to clear
2023-12-15 19:51:57 +00:00
rodrlyra
6ef56849a5 0033542: Visualization, AIS_ViewController - New AIS_DragAction for when drag interaction is confirmed
Added AIS_DragAction_Confirmed drag action, which will be called by AIS_ViewController when the drag interaction is confirmed (mouse moved more than click threshold).
2023-12-15 19:51:25 +00:00
dpasukhi
e8605596c9 0033548: Tests - VC142 internal problem for Chamfer functionality
Update test cases for Jenkins old compiler. Mark as BAD
2023-12-12 17:28:20 +00:00
16 changed files with 136 additions and 52 deletions

View File

@@ -17,10 +17,11 @@
//! Dragging action.
enum AIS_DragAction
{
AIS_DragAction_Start, //!< (try) start dragging object
AIS_DragAction_Update, //!< perform dragging (update position)
AIS_DragAction_Stop, //!< stop dragging (save position)
AIS_DragAction_Abort, //!< abort dragging (restore initial position)
AIS_DragAction_Start, //!< (try) start dragging object
AIS_DragAction_Confirmed, //!< dragging interaction is confirmed.
AIS_DragAction_Update, //!< perform dragging (update position)
AIS_DragAction_Stop, //!< stop dragging (save position)
AIS_DragAction_Abort, //!< abort dragging (restore initial position)
};
#endif // _AIS_DragAction_HeaderFile

View File

@@ -259,6 +259,10 @@ Standard_Boolean AIS_LightSource::ProcessDragging (const Handle(AIS_InteractiveC
myLocTrsfStart = LocalTransformation();
return Standard_True;
}
case AIS_DragAction_Confirmed:
{
return Standard_True;
}
case AIS_DragAction_Update:
{
mySensSphere->ResetLastDetectedPoint();

View File

@@ -661,6 +661,10 @@ Standard_Boolean AIS_Manipulator::ProcessDragging (const Handle(AIS_InteractiveC
}
break;
}
case AIS_DragAction_Confirmed:
{
return Standard_True;
}
case AIS_DragAction_Update:
{
Transform (theDragTo.x(), theDragTo.y(), theView);

View File

@@ -332,6 +332,11 @@ void AIS_ViewController::flushBuffers (const Handle(AIS_InteractiveContext)& ,
myGL.Dragging.ToStart = true;
myGL.Dragging.PointStart = myUI.Dragging.PointStart;
}
if (myUI.Dragging.ToConfirm)
{
myUI.Dragging.ToConfirm = false;
myGL.Dragging.ToConfirm = true;
}
if (myUI.Dragging.ToMove)
{
myUI.Dragging.ToMove = false;
@@ -928,6 +933,7 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
myMouseClickCounter = 0;
myMouseSingleButton = -1;
myMouseStopDragOnUnclick = true;
myUI.Dragging.ToConfirm = true;
}
}
@@ -2738,6 +2744,17 @@ void AIS_ViewController::OnObjectDragged (const Handle(AIS_InteractiveContext)&
}
return;
}
case AIS_DragAction_Confirmed:
{
if (myDragObject.IsNull())
{
return;
}
myDragObject->ProcessDragging (theCtx, theView, myDragOwner, myGL.Dragging.PointStart,
myGL.Dragging.PointTo, theAction);
return;
}
case AIS_DragAction_Update:
{
if (myDragObject.IsNull())
@@ -3057,6 +3074,10 @@ void AIS_ViewController::handleDynamicHighlight (const Handle(AIS_InteractiveCon
}
else if (myGL.Dragging.ToMove)
{
if (myGL.Dragging.ToConfirm)
{
OnObjectDragged (theCtx, theView, AIS_DragAction_Confirmed);
}
OnObjectDragged (theCtx, theView, AIS_DragAction_Update);
myGL.OrbitRotation.ToRotate = false;
myGL.ViewRotation .ToRotate = false;

View File

@@ -87,13 +87,14 @@ public:
struct _draggingParams
{
bool ToStart; //!< start dragging
bool ToConfirm; //!< confirm dragging
bool ToMove; //!< perform dragging
bool ToStop; //!< stop dragging
bool ToAbort; //!< abort dragging (restore previous position)
Graphic3d_Vec2i PointStart; //!< drag start point
Graphic3d_Vec2i PointTo; //!< drag end point
_draggingParams() : ToStart (false), ToMove (false), ToStop (false), ToAbort (false) {}
_draggingParams() : ToStart (false), ToConfirm (false), ToMove (false), ToStop (false), ToAbort (false) {}
} Dragging;
struct _orbitRotation
@@ -139,12 +140,13 @@ public:
Selection.ToApplyTool = false;
IsNewGesture = false;
ZoomActions.Clear();
Panning.ToStart = false;
Panning.ToPan = false;
Dragging.ToStart = false;
Dragging.ToMove = false;
Dragging.ToStop = false;
Dragging.ToAbort = false;
Panning.ToStart = false;
Panning.ToPan = false;
Dragging.ToStart = false;
Dragging.ToConfirm = false;
Dragging.ToMove = false;
Dragging.ToStop = false;
Dragging.ToAbort = false;
OrbitRotation.ToStart = false;
OrbitRotation.ToRotate = false;
ViewRotation.ToStart = false;

View File

@@ -492,10 +492,9 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
#ifdef OCCT_DEBUG
if (BRepCheck_Trace(0) > 1) {
TopTools_DataMapIteratorOfDataMapOfShapeInteger itt(MapOfShapeOrientation);
Standard_Integer upper = MapOfShapeOrientation.NbBuckets();
std::cout << "La map shape Orientation :" << std::endl;
for (; itt.More(); itt.Next()) {
PrintShape(itt.Key(), upper);
PrintShape(itt.Key());
}
std::cout << std::endl;
}
@@ -716,7 +715,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
if (BRepCheck_Trace(0) > 3)
{
std::cout << "Fref : " ;
PrintShape(Fref, MapOfShapeOrientation.NbBuckets());
PrintShape(Fref);
}
#endif
@@ -766,7 +765,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
if (BRepCheck_Trace(0) > 3)
{
std::cout << " Fcur : " ;
PrintShape(Fcur, MapOfShapeOrientation.NbBuckets());
PrintShape(Fcur);
}
#endif
for (edFcur.Init(Fcur, TopAbs_EDGE); edFcur.More(); edFcur.Next())
@@ -794,7 +793,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
Fcur.Orientation(orf);
std::cout << " Error : this face has been already examined " << std::endl;
std::cout << " Impossible to return it ";
PrintShape(Fcur, MapOfShapeOrientation.NbBuckets());
PrintShape(Fcur);
}
#endif
return myOstat;
@@ -809,7 +808,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fcur);
Fcur.Orientation(orf);
std::cout << " Resulting Fcur is returned : " ;
PrintShape(Fcur, MapOfShapeOrientation.NbBuckets());
PrintShape(Fcur);
}
#endif

View File

@@ -178,7 +178,7 @@ public:
isDouble(theOther.isDouble)
{
theOther.myData1 = nullptr;
theOther.myData1 = nullptr;
theOther.myData2 = nullptr;
theOther.mySize = 0;
theOther.myNbBuckets = 0;
}

View File

@@ -29,8 +29,50 @@
* IsEqual.
*/
template <class TheKeyType>
DEFINE_HASHER(NCollection_DefaultHasher, TheKeyType, std::hash<TheKeyType>, std::equal_to<TheKeyType>)
struct NCollection_DefaultHasher
{
size_t operator()(const TheKeyType& theKey) const noexcept
{
return HashCode<TheKeyType>(theKey);
}
bool operator() (const TheKeyType& theK1, const TheKeyType& theK2) const noexcept
{
return IsEqual<TheKeyType>(theK1, theK2);
}
private:
// For non-enums
template <class T = TheKeyType>
typename std::enable_if<!std::is_enum<T>::value, size_t>::type
HashCode(const TheKeyType& theKey) const noexcept
{
return std::hash<TheKeyType>{}(theKey);
}
// For non-enums
template <class T = TheKeyType>
typename std::enable_if<!std::is_enum<T>::value, bool>::type
IsEqual(const TheKeyType& theK1, const TheKeyType& theK2) const noexcept
{
return std::equal_to<TheKeyType>{}(theK1, theK2);
}
// For enums
template <class T = TheKeyType>
typename std::enable_if<std::is_enum<T>::value, size_t>::type
HashCode(const TheKeyType& theKey) const noexcept
{
return static_cast<size_t>(theKey);
}
// For enums
template <class T = TheKeyType>
typename std::enable_if<std::is_enum<T>::value, bool>::type
IsEqual(const TheKeyType& theK1, const TheKeyType& theK2) const noexcept
{
return theK1 == theK2;
}
};
#define DEFINE_DEFAULT_HASHER_PURE(TheKeyType) \
template <> struct NCollection_DefaultHasher<TheKeyType> \

View File

@@ -46,15 +46,9 @@ namespace opencascade
}
template <typename T = size_t>
constexpr typename std::enable_if<sizeof(T) == 8, uint64_t>::type optimalSeed()
constexpr T optimalSeed()
{
return 0xA329F1D3A586ULL;
}
template <typename T = size_t>
constexpr typename std::enable_if<sizeof(T) != 8, T >::type optimalSeed()
{
return static_cast<T>(0xc70f6907U);
return sizeof(T) == 8 ? static_cast<T>(0xA329F1D3A586ULL) : static_cast<T>(0xc70f6907U);
}
};
@@ -84,15 +78,9 @@ namespace opencascade
}
template <typename T = size_t>
constexpr typename std::enable_if<sizeof(T) == 8, uint64_t>::type optimalSeed()
constexpr T optimalSeed()
{
return 14695981039346656037ULL;
}
template <typename T = size_t>
constexpr typename std::enable_if<sizeof(T) != 8, T>::type optimalSeed()
{
return static_cast<T>(2166136261U);
return sizeof(T) == 8 ? static_cast<T>(14695981039346656037ULL) : static_cast<T>(2166136261U);
}
};

View File

@@ -14,6 +14,7 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_HashUtils.hxx>
#include <TopLoc_SListOfItemLocation.hxx>
#include <TopLoc_Datum3D.hxx>
#include <TopLoc_ItemLocation.hxx>

View File

@@ -176,11 +176,12 @@ namespace
GetDisplayConnection() = theDisplayConnection;
}
static ViewerTest_ViewerCommandsViewMap ViewerTest_myViews;
static ViewerTest_ViewerCommandsInteractiveContextMap ViewerTest_myContexts;
static ViewerTest_ViewerCommandsGraphicDriverMap ViewerTest_myDrivers;
}
ViewerTest_ViewerCommandsViewMap ViewerTest_myViews;
static struct
{
Quantity_Color FlatColor;

View File

@@ -1,3 +1,4 @@
puts "TODO OCC33548 Windows: compute of chamfer failed"
puts "================"
puts "OCC116"
@@ -14,12 +15,8 @@ explode sh f
explode sh_6 e
if [catch {chamf result sh sh_6_1 sh_6 A 2 45 sh_6_8 sh_6 A 2 45 } catch_result] {
puts "1) Faulty OCC116: chamfer is NOT created properly"
} else {
puts "1) CHAMF OCC116 OK"
checkprops result -s 48357.5
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png
}
checkprops result -s 48357.5
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,3 +1,6 @@
puts "TODO OCC33548 Windows: compute of chamfer failed"
puts "TODO OCC33548 Windows: TEST INCOMPLETE"
puts "================"
puts "OCC293"
puts "================"

View File

@@ -1,5 +1,5 @@
puts "TODO OCC24156 MacOS: Tcl Exception: compute of chamfer failed"
puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
puts "TODO OCC24156 MacOS: compute of chamfer failed"
puts "TODO OCC33548 Windows: compute of chamfer failed"
puts "================"
puts "OCC266"
@@ -15,9 +15,9 @@ explode edge e
renamevar edge face
explode face f
chamf result face edge_10 face_3 A 1 45 edge_6 face_3 A 1 45 edge_11 face_3 A 1 45 edge_12 face_3 A 1 45 edge_13 face_3 A 1 45 edge_14 face_3 A 1 45 edge_8 face_3 A 1 45 edge_9 face_3 A 1 45
checkshape result
checkprops result -s 48913
checkview -display result -2d -path ${imagedir}/${test_image}.png
if [catch {chamf result face edge_10 face_3 A 1 45 edge_6 face_3 A 1 45 edge_11 face_3 A 1 45 edge_12 face_3 A 1 45 edge_13 face_3 A 1 45 edge_14 face_3 A 1 45 edge_8 face_3 A 1 45 edge_9 face_3 A 1 45 } catch_result] {
} else {
checkshape result
checkprops result -s 48913
checkview -display result -2d -path ${imagedir}/${test_image}.png
}

View File

@@ -6,7 +6,7 @@ set chamf_equal_dist [list "0.03 " "0.05 " "0.05 " "0.03 " "0.05
if { [string compare $command chamf_sequence] == 0 } {
if {[string compare $group dist_angle] == 0} {
puts "TODO OCC22909 All: compute of chamfer failed"
puts "TODO OCC22909 All:Faulty shapes in variables faulty_1 to faulty_6"
puts "TODO OCC22909 Linux:Faulty shapes in variables faulty_1 to faulty_6"
}
if {[string compare $group dist_dist] == 0} {
puts "TODO OCC22909 All: compute of chamfer failed"

View File

@@ -1,3 +1,24 @@
set shouldFailed 0
if { $group eq "dist_angle" && $command eq "chamf" } {
if { ($test_image eq "A3" && $chamf_shape eq "test-fillet.brep") ||
($test_image eq "E5" && $chamf_shape eq "CCH_testchet.rle") ||
($test_image eq "A1" && $chamf_shape eq "CCH_001_ahdb.rle") ||
($test_image eq "A4" && $chamf_shape eq "test-fillet.brep") ||
($test_image eq "A5" && $chamf_shape eq "test-fillet.brep") } {
set shouldFailed 1
}
} elseif { $group eq "dist_angle" && $command eq "chamf_sequence" } {
if { ($test_image eq "A1" && $chamf_shape eq "CCH_001_ahdb.rle") ||
($test_image eq "A4" && $chamf_shape eq "test-fillet.brep") } {
set shouldFailed 1
}
}
if {$shouldFailed} {
puts "TODO OCC33548 Windows: compute of chamfer failed"
}
restore [locate_data_file $chamf_shape] sh
if { [dval SCALE] != 0 } {
tscale sh 0 0 0 SCALE