#include <stdexcept>
#include <utilities.h>
+#ifdef _DEBUG_
+static int MYDEBUG = 1;
+#else
+static int MYDEBUG = 0;
+#endif
+
+
// tabs
enum {
STD_TAB = 0,
if (ok) {
model->setData(index, value, Qt::EditRole);
- MESSAGE("Value " << value << " was set at index(" << index.row() << "," << index.column() << ")");
+ if(MYDEBUG) MESSAGE("Value " << value << " was set at index(" << index.row() << "," << index.column() << ")");
}
}
// MESSAGE("Found y value " << y << " at row " << i);
double myZ = mySmpModel->data(mySmpModel->index(i, ENF_VER_Z_COLUMN)).toDouble();
if (myZ == z) {
- MESSAGE("Found x value " << x << " at row " << i);
- MESSAGE("Found y value " << y << " at row " << i);
- MESSAGE("Found z value " << z << " at row " << i);
+ if (MYDEBUG){
+ MESSAGE("Found x value " << x << " at row " << i);
+ MESSAGE("Found y value " << y << " at row " << i);
+ MESSAGE("Found z value " << z << " at row " << i);
+ }
return true;
}
}
void HEXABLOCKPluginGUI_HypothesisCreator::onVertexBtnClicked()
{
- MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::onVertexBtnClicked()");
+ if (MYDEBUG) MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::onVertexBtnClicked()");
const int row = mySmpModel->rowCount() ;
double x = myXCoord->text().toDouble();
double y = myYCoord->text().toDouble();
it.toBack();
while ( it.hasPrevious() ) {
row = it.previous();
- MESSAGE("delete row #"<< row);
+ if (MYDEBUG) MESSAGE("delete row #"<< row);
mySmpModel->removeRow(row );
}
myEnforcedTableView->clearSelection();
bool HEXABLOCKPluginGUI_HypothesisCreator::checkParams(QString& msg) const
{
- MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::checkParams");
+ if (MYDEBUG) MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::checkParams");
if ( !QFileInfo( myWorkingDir->text().trimmed() ).isWritable() ) {
SUIT_MessageBox::warning( dlg(),
void HEXABLOCKPluginGUI_HypothesisCreator::retrieveParams() const
{
- MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::retrieveParams");
+ if (MYDEBUG) MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::retrieveParams");
HEXABLOCKHypothesisData data;
readParamsFromHypo( data );
mySmpModel->setData(mySmpModel->index(row, ENF_VER_SIZE_COLUMN),size);
mySmpModel->setItem( row, ENF_VER_SIZE_COLUMN, new QStandardItem(QString::number(size)) );
- MESSAGE("Row " << row << ": (" << x << ","<< y << ","<< z << ") ="<< size);
+ if (MYDEBUG) MESSAGE("Row " << row << ": (" << x << ","<< y << ","<< z << ") ="<< size);
row++;
}
QString HEXABLOCKPluginGUI_HypothesisCreator::storeParams() const
{
- MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::storeParams");
+ if (MYDEBUG) MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::storeParams");
HEXABLOCKHypothesisData data;
readParamsFromWidgets( data );
storeParamsToHypo( data );
valStr += ";";
}
valStr += " #END ENFORCED VERTICES#";
- MESSAGE(valStr.toStdString());
+ if (MYDEBUG) MESSAGE(valStr.toStdString());
return valStr;
}
bool HEXABLOCKPluginGUI_HypothesisCreator::readParamsFromHypo( HEXABLOCKHypothesisData& h_data ) const
{
- MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::readParamsFromHypo");
+ if (MYDEBUG) MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::readParamsFromHypo");
HEXABLOCKPlugin::HEXABLOCKPlugin_Hypothesis_var h =
HEXABLOCKPlugin::HEXABLOCKPlugin_Hypothesis::_narrow( initParamsHypothesis() );
bool HEXABLOCKPluginGUI_HypothesisCreator::storeParamsToHypo( const HEXABLOCKHypothesisData& h_data ) const
{
- MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::storeParamsToHypo");
+ if (MYDEBUG) MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::storeParamsToHypo");
HEXABLOCKPlugin::HEXABLOCKPlugin_Hypothesis_var h =
HEXABLOCKPlugin::HEXABLOCKPlugin_Hypothesis::_narrow( hypothesis() );
bool HEXABLOCKPluginGUI_HypothesisCreator::readParamsFromWidgets( HEXABLOCKHypothesisData& h_data ) const
{
- MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::readParamsFromWidgets");
+ if (MYDEBUG) MESSAGE("HEXABLOCKPluginGUI_HypothesisCreator::readParamsFromWidgets");
h_data.myName = myName ? myName->text() : "";
h_data.myToMeshHoles = myToMeshHolesCheck->isChecked();
h_data.myMaximumMemory = myMaximumMemoryCheck->isChecked() ? myMaximumMemorySpin->value() : -1;
myVertex.push_back(mySmpModel->data(mySmpModel->index(i,ENF_VER_Y_COLUMN)).toDouble());
myVertex.push_back(mySmpModel->data(mySmpModel->index(i,ENF_VER_Z_COLUMN)).toDouble());
myVertex.push_back(mySmpModel->data(mySmpModel->index(i,ENF_VER_SIZE_COLUMN)).toDouble());
- MESSAGE("Add new enforced vertex (" << myVertex[0] << ", "
+ if (MYDEBUG) MESSAGE("Add new enforced vertex (" << myVertex[0] << ", "
<< myVertex[1] << ", "
<< myVertex[2] << ") = "
<< myVertex[3]);
#ifdef _DEBUG_
static int MYDEBUG = 1;
#else
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
#endif
:SMESH_3D_Algo(hypId, studyId, gen),
_doc( doc )
{
- MESSAGE("SMESH_HexaFromSkin_3D::SMESH_HexaFromSkin_3D");
+ if(MYDEBUG) MESSAGE("SMESH_HexaFromSkin_3D::SMESH_HexaFromSkin_3D");
_name = "HexaFromSkin_3D";
}
SMESH_HexaFromSkin_3D::~SMESH_HexaFromSkin_3D()
{
- MESSAGE("SMESH_HexaFromSkin_3D::~SMESH_HexaFromSkin_3D");
+ if(MYDEBUG) MESSAGE("SMESH_HexaFromSkin_3D::~SMESH_HexaFromSkin_3D");
}
//================================================================================
using namespace std;
+#ifdef _DEBUG_
+static int MYDEBUG = 1;
+#else
static int MYDEBUG = 0;
+#endif
//=============================================================================
/*!
HEXABLOCKPlugin_HEXABLOCK::HEXABLOCKPlugin_HEXABLOCK(int hypId, int studyId, SMESH_Gen* gen)
: SMESH_3D_Algo(hypId, studyId, gen)
{
- MESSAGE("HEXABLOCKPlugin_HEXABLOCK::HEXABLOCKPlugin_HEXABLOCK");
+ if(MYDEBUG) MESSAGE("HEXABLOCKPlugin_HEXABLOCK::HEXABLOCKPlugin_HEXABLOCK");
_name = "HEXABLOCK_3D";
_shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type
_compatibleHypothesis.push_back("HEXABLOCK_Parameters");
HEXABLOCKPlugin_HEXABLOCK::~HEXABLOCKPlugin_HEXABLOCK()
{
- MESSAGE("HEXABLOCKPlugin_HEXABLOCK::~HEXABLOCKPlugin_HEXABLOCK");
+ if(MYDEBUG) MESSAGE("HEXABLOCKPlugin_HEXABLOCK::~HEXABLOCKPlugin_HEXABLOCK");
}
//=============================================================================
//=============================================================================
bool HEXABLOCKPlugin_HEXABLOCK::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theShape) {
- MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute with a shape");
+ if(MYDEBUG) MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute with a shape");
SMESHDS_Mesh* meshDS = theMesh.GetMeshDS();
if ( (_iShape == 0) && (_nbShape == 0) ) {
bool HEXABLOCKPlugin_HEXABLOCK::Compute(SMESH_Mesh& theMesh,
SMESH_MesherHelper* aHelper)
{
- MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute without a shape");
+ if(MYDEBUG) MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute without a shape");
switch (_hyp->GetDimension()) {
case 0 : return( Compute0D(theMesh) );
const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap)
{
- MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Evaluate: do nothing");
+ if(MYDEBUG) MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Evaluate: do nothing");
return true;
}
//=============================================================================
bool HEXABLOCKPlugin_HEXABLOCK::Compute3D(SMESH_Mesh& theMesh) {
- MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute 3D");
+ if(MYDEBUG) MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute 3D Begin");
SMESH_HexaBlocks hexaBuilder(theMesh);
HEXA_NS::Document* doc = _hyp->GetDocument();
hexaBuilder.computeDoc(doc);
- hexaBuilder.buildGroups(doc);
+ hexaBuilder.buildGroups(doc);
+ if(MYDEBUG) MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute 3D End");
return true;
}
bool HEXABLOCKPlugin_HEXABLOCK::Compute2D(SMESH_Mesh& theMesh)
{
- MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute 2D");
+ if(MYDEBUG) MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute 2D");
HEXA_NS::Document* doc = _hyp->GetDocument();
SMESH_HexaBlocks hexaBuilder(theMesh);
bool HEXABLOCKPlugin_HEXABLOCK::Compute1D(SMESH_Mesh& theMesh)
{
- MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute 1D");
+ if(MYDEBUG) MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute 1D");
HEXA_NS::Document* doc = _hyp->GetDocument();
SMESH_HexaBlocks hexaBuilder(theMesh);
bool HEXABLOCKPlugin_HEXABLOCK::Compute0D(SMESH_Mesh& theMesh)
{
- MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute 0D");
+ if(MYDEBUG) MESSAGE("HEXABLOCKPlugin_HEXABLOCK::Compute 0D");
HEXA_NS::Document* doc = _hyp->GetDocument();
SMESH_HexaBlocks hexaBuilder(theMesh);
#include "utilities.h"
+#ifdef _DEBUG_
+static int MYDEBUG = 1;
+#else
+static int MYDEBUG = 0;
+#endif
+
using namespace std;
//=============================================================================
SMESH_Algo_i( thePOA ),
SMESH_3D_Algo_i( thePOA )
{
- MESSAGE( "HEXABLOCKPlugin_HEXABLOCK_i::HEXABLOCKPlugin_HEXABLOCK_i" );
+ if(MYDEBUG) MESSAGE( "HEXABLOCKPlugin_HEXABLOCK_i::HEXABLOCKPlugin_HEXABLOCK_i" );
myBaseImpl = new ::HEXABLOCKPlugin_HEXABLOCK (theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
HEXABLOCKPlugin_HEXABLOCK_i::~HEXABLOCKPlugin_HEXABLOCK_i()
{
- MESSAGE( "HEXABLOCKPlugin_HEXABLOCK_i::~HEXABLOCKPlugin_HEXABLOCK_i" );
+ if(MYDEBUG) MESSAGE( "HEXABLOCKPlugin_HEXABLOCK_i::~HEXABLOCKPlugin_HEXABLOCK_i" );
}
//=============================================================================
::HEXABLOCKPlugin_HEXABLOCK* HEXABLOCKPlugin_HEXABLOCK_i::GetImpl()
{
- MESSAGE( "HEXABLOCKPlugin_HEXABLOCK_i::GetImpl" );
+ if(MYDEBUG) MESSAGE( "HEXABLOCKPlugin_HEXABLOCK_i::GetImpl" );
return ( ::HEXABLOCKPlugin_HEXABLOCK* )myBaseImpl;
}
#include <Utils_CorbaException.hxx>
#include <utilities.h>
+#ifdef _DEBUG_
+static int MYDEBUG = 1;
+#else
+static int MYDEBUG = 0;
+#endif
+
//=======================================================================
//function : HEXABLOCKPlugin_Hypothesis_i
//=======================================================================
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "HEXABLOCKPlugin_Hypothesis_i::HEXABLOCKPlugin_Hypothesis_i" );
+ if(MYDEBUG) MESSAGE( "HEXABLOCKPlugin_Hypothesis_i::HEXABLOCKPlugin_Hypothesis_i" );
myBaseImpl = new ::HEXABLOCKPlugin_Hypothesis (theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
HEXABLOCKPlugin_Hypothesis_i::~HEXABLOCKPlugin_Hypothesis_i()
{
- MESSAGE( "HEXABLOCKPlugin_Hypothesis_i::~HEXABLOCKPlugin_Hypothesis_i" );
+ if(MYDEBUG) MESSAGE( "HEXABLOCKPlugin_Hypothesis_i::~HEXABLOCKPlugin_Hypothesis_i" );
}
//=============================================================================
#include "HEXABLOCKPlugin_HEXABLOCK_i.hxx"
#include "HEXABLOCKPlugin_Hypothesis_i.hxx"
+
+#ifdef _DEBUG_
+static int MYDEBUG = 1;
+#else
+static int MYDEBUG = 0;
+#endif
+
+
using namespace std;
template <class T> class HEXABLOCKPlugin_Creator_i:public HypothesisCreator_i<T>
HEXABLOCKPLUGIN_EXPORT
GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
{
- MESSAGE("GetHypothesisCreator " << aHypName);
+ if(MYDEBUG) MESSAGE("GetHypothesisCreator " << aHypName);
GenericHypothesisCreator_i* aCreator = 0;
#ifdef _DEBUG_
static int MYDEBUG = 1;
#else
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
#endif
// ASSERT(ok);
if (!ok) throw (SALOME_Exception(LOCALIZED("vertex association : shape2coord() error ")));
newNode = _theMeshDS->AddNode(x, y, z);
- if (_node.count(&vx) >= 1 ) MESSAGE("_node : ALREADY");
+ if (_node.count(&vx) >= 1 and MYDEBUG) MESSAGE("_node : ALREADY");
_node[&vx] = newNode;//needed in computeEdge()
_vertex[newNode] = &vx;
newNode = _theMeshDS->AddNode(x, y, z);
- if (_node.count(&vx) >= 1 ) MESSAGE("_node : ALREADY");
+ if (_node.count(&vx) >= 1 and MYDEBUG) MESSAGE("_node : ALREADY");
_node[&vx] = newNode;//needed in computeEdge()
_vertex[newNode] = &vx;
if (MYDEBUG){
}
}
if ( S1 != nodesOnQuad[0][0] ){
- MESSAGE("ZZZZZZZZZZZZZZZZ quadID = "<<quad.getId());
+ if(MYDEBUG) MESSAGE("ZZZZZZZZZZZZZZZZ quadID = "<<quad.getId());
}
// ASSERT( S1 == nodesOnQuad[0][0] );
for (j = 0, _j = gNodes.size()-1; j < gNodes.size(); ++j, --_j){
nodesOnQuad[0][j] = gNodes[*g_j];
if ( S1 != nodesOnQuad[0][0] ){
- MESSAGE("XXXXXXXXXXXXXXXX quadID = "<<quad.getId());
+ if(MYDEBUG) MESSAGE("XXXXXXXXXXXXXXXX quadID = "<<quad.getId());
}
// ASSERT( S1 == nodesOnQuad[0][0] );
nodesOnQuad[bNodes.size()-1][j] = dNodes[*d_j];
void SMESH_HexaBlocks::buildGroups(HEXA_NS::Document* doc)
{
- MESSAGE("_addGroups() : : begin <<<<<<");
- MESSAGE("_addGroups() : : nb. hexas= " << doc->countUsedHexa());
- MESSAGE("_addGroups() : : nb. quads= " << doc->countUsedQuad());
- MESSAGE("_addGroups() : : nb. edges= " << doc->countUsedEdge());
- MESSAGE("_addGroups() : : nb. nodes= " << doc->countUsedVertex());
-
+ if (MYDEBUG){
+ MESSAGE("_addGroups() : : begin <<<<<<");
+ MESSAGE("_addGroups() : : nb. hexas= " << doc->countUsedHexa());
+ MESSAGE("_addGroups() : : nb. quads= " << doc->countUsedQuad());
+ MESSAGE("_addGroups() : : nb. edges= " << doc->countUsedEdge());
+ MESSAGE("_addGroups() : : nb. nodes= " << doc->countUsedVertex());
+ }
// Looping on each groups of the document
for ( int i=0; i < doc->countGroup(); i++ ){
_fillGroup( doc->getGroup(i) );
};
- MESSAGE("_addGroups() : end >>>>>>>>");
+ if(MYDEBUG) MESSAGE("_addGroups() : end >>>>>>>>");
}
// --------------------------------------------------------------