#include "HexBiCylinder.hxx"
#include "HexVector.hxx"
#include "HexQuad.hxx"
+#include "HexHexa.hxx"
#include "HexGlobale.hxx"
BEGIN_NAMESPACE_HEXA
+// ======================================================== make_normale
+int make_normale (Quads& tquads, double axe[], double& largeur)
+{
+ double lgmoy = 0;
+ Real3 cf, cg, vn;
+ int nbre = tquads.size();
+ if (nbre==0)
+ return HERR;
+
+ double coeff = 0;
+ for (int nro=0 ; nro<nbre ; ++nro)
+ {
+ Quad* quad = tquads[nro];
+ int nbp = quad->getNbrParents();
+ if (nbp!=1)
+ return HERR;
+ // Calcul des cotes
+ for (int nc=0 ; nc<QUAD4 ; ++nc)
+ lgmoy += quad->getEdge(nc)->getLength ();
+ // Calcul de la normale sortante
+ Hexa* hexa = quad->getParent (0);
+ hexa->getCenter (cg);
+ quad->getCenter (cf);
+ calc_vecteur (cg, cf, vn);
+ for (int nc=0 ; nc<DIM3 ; ++nc)
+ axe[nc] = coeff*axe[nc] + vn[nc];
+ coeff = 1;
+ }
+
+ normer_vecteur (axe);
+ largeur = lgmoy / (4*nbre);
+ return HOK;
+}
// ======================================================== makeCartesianTop
Elements* Document::makeCartesianTop (int nx, int ny, int nz)
{
double larg = 1;
Elements* grid = new Elements (this);
- tstart.push_back (start);
-
+ tstart.push_back (start);
grid->checkQuad (start);
- grid->makeNormale (tstart, axe, larg);
+ make_normale (tstart, axe, larg);
for (int nro=0 ; nro<nbre; ++nro) tlen.push_back ((nro+1)*larg);
if (grid->isValid())
double larg = 1;
Elements* grid = new Elements (this);
- grid->checkQuads (tstart);
- grid->makeNormale (tstart, axe, larg);
+ grid->checkQuads (tstart);
+ make_normale (tstart, axe, larg);
for (int nro=0 ; nro<nbre; ++nro) tlen.push_back ((nro+1)*larg);
if (grid->isValid())
int Elements::makeBasicCylinder (RealVector& tdr, RealVector& tda,
RealVector& tdh, bool fill)
{
- int na = tda.size()-1;
- PutData (na);
-
+ int na = tda.size()-1;
cyl_dispo = CYL_NOFILL;
if (fill && na > 3)
{
int test_cartesian6 (int nbargs, cpchar tabargs[])
{
case_name = "cartesian_top";
+ Hex::Document* doc = get_document ();
+
+/***********************
const int size_x = 3;
const int size_y = 4;
const int size_z = 5;
- Hex::Document* doc = get_document ();
-
-/***********************
Hex::Elements* grid1 = doc->makeCartesianTop (size_x, size_y, size_z);
grid1->saveVtk ("makeCartesianTop.vtk");
PutData (grid1->isValid());
doc->saveVtk ("prisme3.vtk");
return HOK;
}
+// ======================================================== test_extrude7
+int test_extrude7 (int nbargs, cpchar tabargs[])
+{
+ const int nr = 2;
+ const int na = 8;
+ const int nh = 3;
+
+ Hex::Document* doc = get_document ();
+ Hex::Elements* grid1 = doc->makeCylinderTop (nr, na, nh);
+
+ Hex::Quads tquads;
+ for (int k=0 ; k<nh ; k++)
+ {
+ Hex::Quad* quad = grid1->getQuadJK (nr, 0, k);
+ quad->setColor (5);
+ tquads.push_back (quad);
+ }
+
+ doc->saveVtk ("grid0.vtk");
+ Hex::Elements* grid2 = doc->extrudeQuadsTop (tquads, 4);
+ doc->saveVtk ("grid1.vtk");
+ return HOK;
+}
// ======================================================== test_revolution6
int test_revolution6 (int nbargs, cpchar tabargs[])
{
_dwMesh->setWidget(_meshTreeView);
_meshTreeView->show();
-// QDockWidget *_dwObjectBrowser = 0;
+ QDockWidget *_dwObjectBrowser = 0;
QWidget* wid = getApp()->objectBrowser()->treeView();
QWidget *w = wid->parentWidget();
while ( w && !_dwObjectBrowser ) {
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+#include "hexa_base.hxx"
#include "HEXABLOCKGUI_Model.hxx"
//#define _DEVDEBUG_
: SalomeApp_DataModel(theModule)
{
DEBTRACE("HEXABLOCKGUI_Model::HEXABLOCKGUI_Model");
+ std::cout << "HEXABLOCKGUI_Model::HEXABLOCKGUI_Model" << std::endl;
}
HEXABLOCKGUI_Model::~HEXABLOCKGUI_Model()
bool HEXABLOCKGUI_Model::save(QStringList& listOfFiles)
{
DEBTRACE("HEXABLOCKGUI_Model::save");
+ std::cout << "HEXABLOCKGUI_Model::save" << std::endl;
return SalomeApp_DataModel::save(listOfFiles);
}
bool HEXABLOCKGUI_Model::saveAs(const QString& fileName, CAM_Study* study, QStringList& listOfFiles)
{
DEBTRACE("HEXABLOCKGUI_Model::saveAs");
+ std::cout << "HEXABLOCKGUI_Model::saveAs" << std::endl;
return SalomeApp_DataModel::saveAs(fileName, study, listOfFiles);
}
-