0028726: Quantity_NameOfColor should be replaced by Quantity_Color in function input...
[occt.git] / dox / dev_guides / upgrade / upgrade.md
index 313b825..b998024 100644 (file)
@@ -333,6 +333,8 @@ The applications that used these data persistence tools need to be updated to us
 
 The existing data files in standard formats can be converted using OCCT 6.9.1 or a previous version, as follows.
 
+@note Reading / writing custom files capability from OCCT 6.9.1 is restored in OCCT 7.2.0. See details in @ref upgrade_720_persistence section.
+
 #### CSFDB files
 
 Files in *CSFDB* format (usually with extension .csfdb) contain OCCT shape data that can be converted to BRep format. 
@@ -1124,6 +1126,23 @@ The following obsolete features have been removed:
   These properties were unused, and therefore application should remove occurrences of these methods.
 * *AIS_InteractiveObject::SelectionPriority()*.
   These property was not implemented.
+* The class *LocOpe_HBuilder* has been removed as obsolete.
+* The package *TestTopOpe* has been removed;
+* The package *TestTopOpeDraw* has been removed;
+* The package *TestTopOpeTools* has been removed.
+* The packages *QANewModTopOpe*, *QANewBRepNaming* and *QANewDBRepNaming* have been removed as containing obsolete features.
+* The following methods of the *IntPolyh_Triangle* class have been removed as unused:
+  - *CheckCommonEdge*
+  - *SetEdgeandOrientation*
+  - *MultipleMiddleRefinement2*.
+* The method *IntPolyh_Triangle::TriangleDeflection* has been renamed to *IntPolyh_Triangle::ComputeDeflection*.
+* The following methods of the *IntPolyh_MaillageAffinage* class have been removed as unused:
+  - *LinkEdges2Triangles*;
+  - *TriangleEdgeContact2*;
+  - *StartingPointsResearch2*;
+  - *NextStartingPointsResearch2*;
+  - *TriangleComparePSP*;
+  - *StartPointsCalcul*.
 
 @subsection upgrade_occt720_correction_of_Offset_API Corrections in BRepOffset API
 
@@ -1211,6 +1230,12 @@ The following Grid management methods within class V3d_Viewer do not implicitly
   ActivateGrid, DeactivateGrid, SetRectangularGridValues, SetCircularGridValues,
   RectangularGridGraphicValues, CircularGridGraphicValues, SetPrivilegedPlane, DisplayPrivilegedPlane.
 
+@subsection upgrade_720_v3d_colorname Elimination of Quantity_NameOfColor from TKV3d interface classes
+
+The duplicating interface methods accepting *Quantity_NameOfColor* (in addition to methods accepting *Quantity_Color*) of TKV3d toolkit have been removed.
+In most cases this change should be transparent, however applications implementing such interface methods should also remove them
+(compiler will automatically highlight this issue for methods marked with Standard_OVERRIDE keyword).
+
 @subsection upgrade_720_Result_Of_BOP_On_Containers Result of Boolean operations on containers
 
 * The result of Boolean operations on arguments of collection types (WIRE/SHELL/COMPSOLID) is now filtered from duplicating containers.
@@ -1221,10 +1246,143 @@ The following Grid management methods within class V3d_Viewer do not implicitly
 * Types GeomPlate_Array1OfHCurveOnSurface and GeomPlate_HArray1OfHCurveOnSurface have been replaced with GeomPlate_Array1OfHCurve and GeomPlate_HArray1OfHCurve correspondingly (accept base class Adaptor3d_HCurve instead of Adaptor3d_HCurveOnSurface).
 * Enumeration *Image_PixMap::ImgFormat*, previously declared as nested enumeration within class *Image_PixMap*, has been moved to global namespace as *Image_Format* following OCCT coding rules.
   The enumeration values have suffix Image_Format_ and preserve previous name scheme for easy renaming of old values - e.g. Image_PixMap::ImgGray become Image_Format_Gray.
-  Old definitions are preserved as depreacated aliases to the new ones.
+  Old definitions are preserved as depreacated aliases to the new ones;
+* The method BOPAlgo_Builder::Origins() returns BOPCol_DataMapOfShapeListOfShape instead of BOPCol_DataMapOfShapeShape.
 
 @subsection upgrade_720_BOP_DataStructure BOP - Pairs of interfering indices
 
 * The classes *BOPDS_PassKey* and *BOPDS_PassKeyBoolean* are too excessive and not used any more in Boolean Operations. To replace them the new *BOPDS_Pair* class has been implemented. Thus:
   - The method *BOPDS_DS::Interferences()* now returns the *BOPDS_MapOfPair*;
   - The method *BOPDS_Iterator::Value()* takes now only two parameters - the indices of interfering sub-shapes.
+
+@subsection upgrade_720_Removal_Of_Old_Boolean_Operations_Draw Removal of the Draw commands based on old Boolean operations
+
+* The commands *fubl* and *cubl* have been removed. The alternative for these commands are the commands *bfuseblend* and *bcutblend* respectively.
+* The command *ksection* has been removed. The alternative for this command is the command *bsection*.
+
+@subsection upgrade_720_Change_Of_FaceFace_Intersection Change of Face/Face intersection in Boolean operations
+
+* Previously, the intersection tolerance for all section curves between pair of faces has been calculated as the maximal tolerance among all curves.
+  Now, each curve has its own valid tolerance calculated as the maximal deviation of the 3D curve from its 2D curves or surfaces in case there are no 2D curves.
+* The methods *IntTools_FaceFace::TolReached3d()*, *IntTools_FaceFace::TolReal()* and *IntTools_FaceFace::TolReached2d()* have been removed.
+* Intersection tolerances of the curve can be obtained from the curve itself:
+  - *IntTools_Curve::Tolerance()* - returns the valid tolerance for the curve;
+  - *IntTools_Curve::TangentialTolerance()* - returns the tangential tolerance, which reflects the size of the common between faces.
+* 2d tolerance (*IntTools_FaceFace::TolReached2d()*) has been completely removed from the algorithm as unused.
+
+
+@subsection upgrade_720_persistence Restore OCCT 6.9.1 persistence
+  
+The capability of reading / writing files in old format using *Storage_ShapeSchema* functionality from OCCT 6.9.1 has been restored in OCCT 7.2.0. 
+
+One can use this functionality in two ways:
+- invoke DRAW Test Harness commands *fsdread / fsdwrite* for shapes;
+- call *StdStorage* class *Read / Write* functions in custom code.
+
+The code example below demonstrates how to read shapes from a storage driver using *StdStorage* class. 
+
+~~~~
+// aDriver should be created and opened for reading
+Handle(StdStorage_Data) aData;
+
+// Read data from the driver
+// StdStorage::Read creates aData instance automatically if it is null
+Storage_Error anError = StdStorage::Read(*aDriver, aData);
+if (anError != Storage_VSOk)
+{
+  // Error processing
+}
+
+// Get root objects
+Handle(StdStorage_RootData) aRootData = aData->RootData();
+Handle(StdStorage_HSequenceOfRoots) aRoots = aRootData->Roots();
+if (!aRoots.IsNull())
+{
+  // Iterator over the sequence of root objects
+  for (StdStorage_HSequenceOfRoots::Iterator anIt(*aRoots); anIt.More(); anIt.Next())
+  {
+    Handle(StdStorage_Root)& aRoot = anIt.ChangeValue();
+       // Get a persistent root's object
+    Handle(StdObjMgt_Persistent) aPObject = aRoot->Object();
+    if (!aPObject.IsNull())
+    {
+      Handle(ShapePersistent_TopoDS::HShape) aHShape = Handle(ShapePersistent_TopoDS::HShape)::DownCast(aPObject);
+      if (aHShape) // Downcast to an expected type to import transient data
+      {
+        TopoDS_Shape aShape = aHShape->Import();
+        shapes.Append(aShape);
+      }
+    }
+  }
+}
+~~~~
+
+The following code demonstrates how to write shapes in OCCT 7.2.0 using *StdStorage* class.
+
+~~~~
+// Create a file driver
+NCollection_Handle<Storage_BaseDriver> aFileDriver(new FSD_File());
+
+// Try to open the file driver for writing
+try
+{
+  OCC_CATCH_SIGNALS
+  PCDM_ReadWriter::Open(*aFileDriver, TCollection_ExtendedString(CStringA(filename).GetBuffer()), Storage_VSWrite);
+}
+catch (Standard_Failure& e)
+{
+  // Error processing
+}
+
+// Create a storage data instance
+Handle(StdStorage_Data) aData = new StdStorage_Data;
+// Set an axiliary application name (optional)
+aData->HeaderData()->SetApplicationName(TCollection_ExtendedString("Application"));
+
+// Provide a map to track sharing
+StdObjMgt_TransientPersistentMap aMap;
+// Iterator over a collection of shapes
+for (Standard_Integer i = 1; i <= shapes.Length(); ++i)
+{
+  TopoDS_Shape aShape = shapes.Value(i);
+  // Translate a shape to a persistent object
+  Handle(ShapePersistent_TopoDS::HShape) aPShape =
+    ShapePersistent_TopoDS::Translate(aShape, aMap, ShapePersistent_WithTriangle);
+  if (aPShape.IsNull())
+  {
+    // Error processing
+  }
+
+  // Construct a root name
+  TCollection_AsciiString aName = "Shape_";
+  aName += i;
+
+  // Add a root to storage data
+  Handle(StdStorage_Root) aRoot = new StdStorage_Root(aName, aPShape);
+  aData->RootData()->AddRoot(aRoot);
+}
+
+// Write storage data to the driver
+Storage_Error anError = StdStorage::Write(*aFileDriver, aData);
+if (anError != Storage_VSOk)
+{
+  // Error processing
+}
+~~~~
+
+@subsection upgrade_720_Change_In_BRepLib_MakeFace_Algo Change in BRepLib_MakeFace algorithm
+
+  Previously, *BRepLib_MakeFace* algorithm changed orientation of the source wire in order to avoid creation of face as a hole (i.e. it is impossible to create the entire face as a hole; the hole can be created in context of another face only). New algorithm does not reverse the wire if it is open. Material of the face for the open wire will be located on the left side from the source wire.
+
+@subsection upgrade_720_Change_In_BRepFill_OffsetWire Change in BRepFill_OffsetWire algorithm
+
+  From now on, the offset  will always be directed to the outer region in case of positive offset value and to the inner region in case of negative offset value.
+  Inner/Outer region for an open wire is defined by the following rule:
+    when we go along the wire (taking into account edges orientation) the outer region will be on the right side, the inner region will be on the left side.
+  In case of a closed wire, the inner region will always be inside the wire (at that, the edges orientation is not taken into account).
+  
+@subsection upgrade_720_Change_In_GeomAdaptor_Curve Change in Geom(2d)Adaptor_Curve::IsPeriodic
+  
+Since 7.2.0 version, method *IsPeriodic()* returns the corresponding status of periodicity of the basis curve regardless of closure status of the adaptor curve (see method *IsClosed()*).
+Method *IsClosed()* for adaptor can return false even on periodic curve, in the case if its parametric range is not full period, e.g. for adaptor on circle in range [0, @f$ \pi @f$].
+In previous versions, *IsPeriodic()* always returned false if *IsClosed()* returned false.