1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-26 11:05:31 +03:00
occt/src/ShapeUpgrade/ShapeUpgrade_ShapeDivideArea.cxx
jgv 07e803dee1 0032999: Modeling Algorithms - New option in ShapeUpgrade_ShapeDivide algorithm: splitting into N parts, into N*M parts
1. Multiple changes in ShapeUpgrade_ShapeDivideArea, ShapeUpgrade_FaceDivide, ShapeUpgrade_FaceDivideArea, ShapeUpgrade_SplitSurface, ShapeUpgrade_SplitSurfaceArea: new methods NbParts and SetSplittingByNumber, changes in ShapeUpgrade_FaceDivideArea::Perform and ShapeUpgrade_SplitSurfaceArea::Compute concerning new modes of splitting.
2. New Draw command "DT_SplitByNumber" for testing new modes of splitting.
3. New subgroups "split_number" and "split_two_numbers" in the group of tests "heal" for testing new modes of splitting.
2022-06-30 19:33:34 +03:00

64 lines
2.2 KiB
C++

// 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.
#include <Precision.hxx>
#include <ShapeUpgrade_FaceDivide.hxx>
#include <ShapeUpgrade_FaceDivideArea.hxx>
#include <ShapeUpgrade_ShapeDivideArea.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : ShapeUpgrade_ShapeDivideArea
//purpose :
//=======================================================================
ShapeUpgrade_ShapeDivideArea::ShapeUpgrade_ShapeDivideArea():
ShapeUpgrade_ShapeDivide()
{
myMaxArea = Precision::Infinite();
myNbParts = 0;
myUnbSplit = myVnbSplit = -1;
myIsSplittingByNumber = Standard_False;
}
//=======================================================================
//function : ShapeUpgrade_ShapeDivideArea
//purpose :
//=======================================================================
ShapeUpgrade_ShapeDivideArea::ShapeUpgrade_ShapeDivideArea(const TopoDS_Shape& S):
ShapeUpgrade_ShapeDivide(S)
{
myMaxArea = Precision::Infinite();
myNbParts = 0;
myUnbSplit = myVnbSplit = -1;
myIsSplittingByNumber = Standard_False;
}
//=======================================================================
//function : GetSplitFaceTool
//purpose :
//=======================================================================
Handle(ShapeUpgrade_FaceDivide) ShapeUpgrade_ShapeDivideArea::GetSplitFaceTool() const
{
Handle(ShapeUpgrade_FaceDivideArea) aFaceTool = new ShapeUpgrade_FaceDivideArea;
aFaceTool->MaxArea() = myMaxArea;
aFaceTool->NbParts() = myNbParts;
aFaceTool->SetNumbersUVSplits (myUnbSplit, myVnbSplit);
aFaceTool->SetSplittingByNumber (myIsSplittingByNumber);
return aFaceTool;
}