#include <Precision.hxx>
-#include <PCollection_HAsciiString.hxx>
-
#include <cstdio>
#include <cmath>
#include <iostream>
#include <BRepAlgo_Cut.hxx>
#include <NCollection_Map.hxx>
#include <NCollection_Handle.hxx>
+#include <NCollection_IncAllocator.hxx>
#include <TCollection_HAsciiString.hxx>
#include <GeomFill_Trihedron.hxx>
#include <BRepOffsetAPI_MakePipe.hxx>
-#include <Standard_Atomic.hxx>
+#include <TopExp_Explorer.hxx>
#include <Standard_Version.hxx>
return 0;
}
-static Standard_Integer OCC142 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** /*argv*/)
-{
- for(Standard_Integer i= 0;i <= 20;i++){
- Handle(PCollection_HAsciiString) pstr = new PCollection_HAsciiString("TEST");
- pstr->Clear();
- }
- di << "OCC142: OK" << "\n";
- return 0;
-}
-
static Standard_Integer OCC23361 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** /*argv*/)
{
gp_Pnt p(0, 0, 2);
HT aHandle;
// QVERIFY (aHandle.IsNull());
QCOMPARE (aHandle.IsNull(), Standard_True);
- const T* p = aHandle.Access();
+ const T* p = aHandle.get();
#if OCC_VERSION_HEX > 0x060700
//QVERIFY (!p);
//QVERIFY (p == 0);
aHandle = new T;
//QVERIFY (!aHandle.IsNull());
QCOMPARE (!aHandle.IsNull(), Standard_True);
- p = aHandle.Access();
+ p = aHandle.get();
//QVERIFY (p);
//QVERIFY (p != 0);
QCOMPARE (p != NULL, Standard_True);
if (n != 1) return 1;
DoIsNull<Standard_Transient, Handle(Standard_Transient)>(di);
- DoIsNull<Standard_Persistent, Handle(Standard_Persistent)>(di);
return 0;
}
std::cerr << "QABugs_HandleClass[" << this << "] " << theArgVec[0] << "\n";
return 0;
}
- DEFINE_STANDARD_RTTI(QABugs_HandleClass) // Type definition
+ DEFINE_STANDARD_RTTI(QABugs_HandleClass, Standard_Transient) // Type definition
};
DEFINE_STANDARD_HANDLE (QABugs_HandleClass, Standard_Transient)
-IMPLEMENT_STANDARD_HANDLE (QABugs_HandleClass, Standard_Transient)
-IMPLEMENT_STANDARD_RTTIEXT(QABugs_HandleClass, Standard_Transient)
+
// Dummy class to test interface for compilation issues
struct QABugs_NHandleClass
return 0;
}
-#include <IGESControl_Reader.hxx>
-#include <IGESControl_Controller.hxx>
-#include <IGESData_IGESEntity.hxx>
-#include <BRepCheck_Analyzer.hxx>
-#include <PTColStd_TransientPersistentMap.hxx>
-#include <PTopoDS_HShape.hxx>
-#include <Storage_Data.hxx>
-#include <TopExp_Explorer.hxx>
-#include <MgtBRep.hxx>
-#include <FSD_File.hxx>
-#include <ShapeSchema.hxx>
-#include <TColStd_HSequenceOfTransient.hxx>
-#include <PTColStd_PersistentTransientMap.hxx>
-#include <Storage_Root.hxx>
-
-static Standard_Integer OCC24565 (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
-{
- if (argc != 3) {
- di << "Usage : " << argv[0] << " FileNameIGS FileNameSTOR";
- return 1;
- }
-
- Standard_CString sFileNameIGS = argv[1];
- Standard_CString sFileNameSTOR = argv[2];
-
- IGESControl_Reader ICReader;
-
- /* * * * * * *
- * Read the IGES file and make sure it is valid
- *
- * * * * * * */
- IGESControl_Controller::Init();
-
- if (!ICReader.ReadFile(sFileNameIGS)) {
- printf("%s:%d - Error reading '%s'\n",__FUNCTION__,__LINE__,sFileNameIGS);fflush(stdout);
- return -1;
- }
-
- int nbShapes = ICReader.NbShapes();
-
- printf("%s:%d - nbShapes = '%d'\n",__FUNCTION__,__LINE__,nbShapes);fflush(stdout);
-
- TopoDS_Shape Shape;
- if(nbShapes == 0)
- {
- Handle(TColStd_HSequenceOfTransient) faces=ICReader.GiveList("iges-faces");
- Handle(TColStd_HSequenceOfTransient) surfaceList=ICReader.GiveList("xst-transferrable-roots",faces);
-
- if (surfaceList.IsNull())
- {
- printf("%s:%d - surfaceList.IsNull()\n",__FUNCTION__,__LINE__);fflush(stdout);
- return -1;
- }
- BRep_Builder builder;
- TopoDS_Compound* pC = new TopoDS_Compound();
- builder.MakeCompound(*pC);
-
- for (int j=1;j<=surfaceList->Length();j++)
- {
- Handle(IGESData_IGESEntity) igesEntity=Handle(IGESData_IGESEntity)::DownCast(surfaceList->Value(j));
- if (igesEntity.IsNull()) continue;
- ICReader.ClearShapes();
- Standard_Boolean rv;
- try {
- rv=ICReader.TransferEntity(igesEntity);
- }
- catch (...) {
- rv=Standard_False;
- }
- if (!rv) {
- printf("%s:%d - Error transferring IGES entity\n",__FUNCTION__,__LINE__);fflush(stdout);
- printf("%s:%d - FormNumber = %d, TypeNumber = %d\n",__FUNCTION__,__LINE__,igesEntity->FormNumber(),igesEntity->TypeNumber());fflush(stdout);
- return -1;
- }
-
- TopoDS_Shape S;
- try {
- S=ICReader.Shape();
- }
- catch(...) {
- printf("%s:%d - Error reading IGES entity\n",__FUNCTION__,__LINE__);fflush(stdout);
- printf("%s:%d - FormNumber = %d, TypeNumber = %d\n",__FUNCTION__,__LINE__,igesEntity->FormNumber(),igesEntity->TypeNumber());fflush(stdout);
- return -1;
- }
- if (S.IsNull()) {
- printf("%s:%d - NULL Surface encountered\n",__FUNCTION__,__LINE__);
- return -1;
- }
-
- try
- {
- builder.Add(*pC,S);
- }
- catch(...)
- {
- printf("%s: Exception adding face.\n",__FUNCTION__);
- }
- }
- Shape = TopoDS_Shape(*pC);
- }
- else
- {
- Shape = ICReader.OneShape();
- }
- {
- BRepCheck_Analyzer brca(Shape);
-
- if(!brca.IsValid())
- {
- printf("%s: Invalid shape after reading IGES file.\n",__FUNCTION__);
- }
- }
-
- /* * * * * * *
- * Write the contents of the Shape to a STOR file
- *
- * * * * * * */
- PTColStd_TransientPersistentMap aMapTP;
- Handle(PTopoDS_HShape) aPShape_write;
- Handle(Storage_Data) d_write=new Storage_Data;
- char Name[32];
-
- TopExp_Explorer Ex;
- int i;
- int max_i = 0;
-
- for (i=0,Ex.Init(Shape,TopAbs_FACE);Ex.More();i++,Ex.Next())
- {
-
- max_i = i;
- try {
- aPShape_write=MgtBRep::Translate(Ex.Current(),aMapTP,MgtBRep_WithoutTriangle);
- }
- catch (...) {
- printf("%s: Error translating surface '%d'\n",__FUNCTION__,i);
- }
-
- sprintf(Name,"S%010d",i);
-
- {
- BRepCheck_Analyzer brca(Ex.Current());
- if(!brca.IsValid())
- {
- printf("INVALID face '%s' in the shape, which will be written to the STOR file.\n",Name);
- }
- }
- try {
- d_write->AddRoot(Name,aPShape_write);
- }
- catch (...) {
- printf("%s: Error adding surface '%d', RootName = '%s'\n",__FUNCTION__,i,Name);
- }
- }
- printf("%s: Going to write %d surfaces.\n",__FUNCTION__,max_i+1);
-
- FSD_File f_write;
- if(f_write.Open(sFileNameSTOR, Storage_VSWrite)!=Storage_VSOk)
- {
- printf("%s: Error opening file: %s\n", __FUNCTION__,sFileNameSTOR);
- return -1;
- }
- Handle(ShapeSchema) s_write=new ShapeSchema;
- s_write->Write(f_write,d_write);
- f_write.Close();
- printf("%s: Wrote to the STOR file.\n",__FUNCTION__);
-
- /* * * * * * *
- * Read the contents of the Shape from a STOR file
- *
- * * * * * * */
- FSD_File f_read;
- if(f_read.Open(sFileNameSTOR, Storage_VSRead)!=Storage_VSOk)
- {
- printf("%s: Error opening file: %s\n", __FUNCTION__,sFileNameSTOR);
- return -1;
- }
- Handle(ShapeSchema) s_read=new ShapeSchema;
- Handle(Storage_Data) d_read=s_read->Read(f_read);
-
- Handle(Standard_Persistent) p;
- Handle(Storage_Root) r;
- Handle(PTopoDS_HShape) aPShape_read;
- PTColStd_PersistentTransientMap aMapPT;
- TopoDS_Shape S_read;
-
- printf("%s: Extracting %d faces from the STOR file.\n",__FUNCTION__,max_i+1);
- for(int i = 0; i <= max_i; ++i)
- {
- sprintf(Name,"S%010d",i);
- r=d_read->Find(Name);
- if(r.IsNull())
- {
- printf("%s:%d '%s' IsNull().\n",__FUNCTION__,__LINE__,Name);fflush(stdout);
- continue;
- }
- p=r->Object();
- aPShape_read = Handle(PTopoDS_HShape)::DownCast(p);
- try {
- MgtBRep::Translate(aPShape_read,aMapPT,S_read,MgtBRep_WithoutTriangle);
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) E=Standard_Failure::Caught();
- std::string str;
- str="Exception: ";
- str+=E->DynamicType()->Name();
- str+=" => ";
- str+=E->GetMessageString();
- printf("%s(1): %s: %s\n",__FUNCTION__,Name,str.c_str());fflush(stdout);
- }
- catch (...) {
- printf("%s(1): Unhandled exception in MgtBRep::Translate\n",__FUNCTION__);
- }
-
- BRepCheck_Analyzer brca(S_read);
-
- if(!brca.IsValid())
- {
- printf("%s: Read INVALID face (%s)!\n",__FUNCTION__,Name);
- }
- }
-
- printf("Completed.\n");fflush(stdout);
-
- return 0;
-}
-
-#include <Handle_BRepTools_NurbsConvertModification.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepTools_NurbsConvertModification.hxx>
BRep_Builder aBuilder;
aBuilder.MakeCompound (aComp);
//NURBS modifier is used to increase footprint of each shape
- Handle_BRepTools_NurbsConvertModification aNurbsModif = new BRepTools_NurbsConvertModification;
+ Handle(BRepTools_NurbsConvertModification) aNurbsModif = new BRepTools_NurbsConvertModification;
TopoDS_Shape aRefShape = BRepPrimAPI_MakeCylinder (50., 100.).Solid();
BRepTools_Modifier aModifier (aRefShape, aNurbsModif);
if (aModifier.IsDone()) {
Handle(TDocStd_Application) anApp = new AppStdL_Application;
Handle(TDocStd_Document) aDoc;
- anApp->NewDocument ("MDTV-Standard", aDoc);
+ anApp->NewDocument ("BinOcaf", aDoc);
TDF_Label aLab = aDoc->Main();
TDataStd_Integer::Set (aLab, 0);
TDataStd_Name::Set (aLab, "test");
Standard_Integer /*theNArg*/,
const char** /*theArgs*/)
{
- math_MultipleVarFunction* aFunc = new BraninFunction();
+ BraninFunction aFunc;
math_Vector aLower(1,2), aUpper(1,2);
aLower(1) = -5;
aCurrPnt1(1) = aLower(1) + (aUpper(1) - aLower(1)) * (i - 1) / (aGridOrder - 1.0);
aCurrPnt1(2) = aLower(2) + (aUpper(2) - aLower(2)) * (j - 1) / (aGridOrder - 1.0);
- aFunc->Value(aCurrPnt1, aFuncValues(idx));
+ aFunc.Value(aCurrPnt1, aFuncValues(idx));
idx++;
}
}
aLipConst = C;
}
- math_GlobOptMin aFinder(aFunc, aLower, aUpper, aLipConst);
+ math_GlobOptMin aFinder(&aFunc, aLower, aUpper, aLipConst);
aFinder.Perform();
//(-pi , 12.275), (pi , 2.275), (9.42478, 2.475)
std::string fileName=argv[1];
mOcafApplication *mCasApp = new mOcafApplication();
Handle(TDocStd_Document) doc;
- mCasApp->NewDocument("MDTV-XCAF", doc);
+ mCasApp->NewDocument("BinXCAF", doc);
STEPCAFControl_Reader stepReader;
IFSelect_ReturnStatus status = stepReader.ReadFile (fileName.c_str());
if (status != IFSelect_RetDone)
return 0;
}
+//=======================================================================
+//function : OCC26284
+//purpose :
+//=======================================================================
+static Standard_Integer OCC26284 (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
+{
+ if (theArgNb != 1)
+ {
+ std::cerr << "Error: wrong number of arguments! See usage:\n";
+ theDI.PrintHelp (theArgVec[0]);
+ return 1;
+ }
+
+ Handle(AIS_InteractiveContext) anAISContext = ViewerTest::GetAISContext();
+ if (anAISContext.IsNull())
+ {
+ std::cerr << "Error: no active view. Please call vinit.\n";
+ return 1;
+ }
+
+ BRepPrimAPI_MakeSphere aSphereBuilder (gp_Pnt (0.0, 0.0, 0.0), 1.0);
+ Handle(AIS_Shape) aSphere = new AIS_Shape (aSphereBuilder.Shape());
+ anAISContext->Display (aSphere);
+ for (Standard_Integer aChildIdx = 0; aChildIdx < 5; ++aChildIdx)
+ {
+ BRepPrimAPI_MakeSphere aBuilder (gp_Pnt (1.0 + aChildIdx, 1.0 + aChildIdx, 1.0 + aChildIdx), 1.0);
+ Handle(AIS_Shape) aChild = new AIS_Shape (aBuilder.Shape());
+ aSphere->AddChild (aChild);
+ anAISContext->Display (aChild);
+ }
+
+ anAISContext->RecomputeSelectionOnly (aSphere);
+
+ return 0;
+}
+
#include <IntTools_Context.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
//purpose :
//=======================================================================
#include <BRepMesh_CircleTool.hxx>
+#include <SelectMgr_EntityOwner.hxx>
static Standard_Boolean inspect_point(const gp_XY& thePoint,
const gp_XY& theCenter,
__FILE__, aNClassPtr, &QABugs_NHandleClass::NHandleProc, group);
theCommands.Add ("OCC230", "OCC230 TrimmedCurve Pnt2d Pnt2d", __FILE__, OCC230, group);
- theCommands.Add ("OCC142", "OCC142", __FILE__, OCC142, group);
theCommands.Add ("OCC23361", "OCC23361", __FILE__, OCC23361, group);
theCommands.Add ("OCC23237", "OCC23237", __FILE__, OCC23237, group);
theCommands.Add ("OCC22980", "OCC22980", __FILE__, OCC22980, group);
theCommands.Add ("OCC24086", "OCC24086 face wire", __FILE__, OCC24086, group);
theCommands.Add ("OCC24622", "OCC24622 texture={1D|2D}\n Tests sourcing of 1D/2D pixmaps for AIS_TexturedShape", __FILE__, OCC24622, group);
theCommands.Add ("OCC24667", "OCC24667 result Wire_spine Profile [Mode [Approx]], no args to get help", __FILE__, OCC24667, group);
- theCommands.Add ("OCC24565", "OCC24565 FileNameIGS FileNameSTOR", __FILE__, OCC24565, group);
theCommands.Add ("OCC24755", "OCC24755", __FILE__, OCC24755, group);
theCommands.Add ("OCC24834", "OCC24834", __FILE__, OCC24834, group);
theCommands.Add ("OCC24889", "OCC24889", __FILE__, OCC24889, group);
theCommands.Add ("xprojponf", "xprojponf p f", __FILE__, xprojponf, group);
theCommands.Add ("OCC24923", "OCC24923", __FILE__, OCC24923, group);
theCommands.Add ("OCC26139", "OCC26139 [-boxsize value] [-boxgrid value] [-compgrid value]", __FILE__, OCC26139, group);
+ theCommands.Add ("OCC26284", "OCC26284", __FILE__, OCC26284, group);
return;
}