Example #1
0
void MeshEditor::selectMesh()
{
	pg::Plant *plant = editor->getPlant();
	int id = meshBox->currentData().toInt();
	pg::Geometry geom = plant->getLeafMesh(id);
	emit meshChanged(geom);
}
Example #2
0
MeshEditor::MeshEditor(SharedResources *shared, Editor *editor,
	QWidget *parent) : QWidget(parent)
{
	this->shared = shared;
	this->editor = editor;
	setFocusPolicy(Qt::StrongFocus);

	QVBoxLayout *columns = new QVBoxLayout(this);
	columns->setSizeConstraint(QLayout::SetMinimumSize);
	columns->setSpacing(0);
	columns->setMargin(0);

	QHBoxLayout *topRow = new QHBoxLayout();
	topRow->setSizeConstraint(QLayout::SetMinimumSize);
	topRow->setSpacing(0);
	topRow->setMargin(0);
	initTopRow(topRow);
	columns->addLayout(topRow);

	meshViewer = new MeshViewer(shared, this);
	columns->addWidget(meshViewer);

	QVBoxLayout *layout = new QVBoxLayout();
	layout->setMargin(10);
	layout->setSpacing(3);
	initFields(layout);
	columns->addLayout(layout);
	columns->addStretch(1);

	connect(this, SIGNAL(meshChanged(pg::Geometry)), meshViewer,
		SLOT(updateMesh(pg::Geometry)));
	connect(meshViewer, SIGNAL(ready()), this, SLOT(addMesh()));
}
Example #3
0
void
FeatureFloodCount::initialSetup()
{
  // Get a pointer to the PeriodicBoundaries buried in libMesh
  _pbs = _fe_problem.getNonlinearSystem().dofMap().get_periodic_boundaries();

  meshChanged();
}
Example #4
0
void
Nemesis::initialSetup()
{
  // Call the base class method
  AdvancedOutput<OversampleOutput>::initialSetup();

  // Make certain that a Nemesis_IO object exists
  meshChanged();
}
Example #5
0
void
Nemesis::initialSetup()
{

  AdvancedOutput::initialSetup();

  // Make certain that a Nemesis_IO object exists
  meshChanged();
}
Example #6
0
void
ExodusOutput::setOutputPosition(const Point & /* p */)
{
  if (_file_num == 0) // This might happen in the case of a MultiApp reset
    _file_num = 1;

  sequence(true);
  meshChanged();
}
Example #7
0
void GeometricRep2D::setMesh(MeshPtr mesh)
{
	if (mesh == mMesh)
		return;
	if (mMesh)
	{
		disconnect(mMesh.get(), SIGNAL(meshChanged()), this, SLOT(meshChangedSlot()));
		disconnect(mMesh.get(), SIGNAL(transformChanged()), this, SLOT(transformChangedSlot()));
	}
	mMesh = mesh;
	if (mMesh)
	{
		connect(mMesh.get(), SIGNAL(meshChanged()), this, SLOT(meshChangedSlot()));
		connect(mMesh.get(), SIGNAL(transformChanged()), this, SLOT(transformChangedSlot()));
		this->meshChangedSlot();
		this->transformChangedSlot();
	}
}
Example #8
0
void MeshEditor::addMesh(pg::Geometry geom)
{
	pg::Plant *plant = editor->getPlant();
	QString qname = QString::fromStdString(geom.getName());
	plant->addLeafMesh(geom);
	meshBox->addItem(qname, QVariant(geom.getId()));
	meshBox->setCurrentIndex(meshBox->findText(qname));
	emit meshChanged(geom);
	emit meshAdded(geom);
}
Example #9
0
void MeshEditor::loadPerpPlane()
{
	if (meshBox->count() > 0) {
		pg::Plant *plant = editor->getPlant();
		int id = meshBox->currentData().toInt();
		pg::Geometry geom = plant->getLeafMesh(id);
		geom.setPerpendicularPlanes();
		plant->addLeafMesh(geom);
		emit meshChanged(geom);
		editor->change();
	}
}
Example #10
0
/**
 * Assign new fiber bundle object
 */
void FiberBundleRep::setBundle(MeshPtr bundle)
{
	// Already has this bundle assigned
	if (hasBundle(bundle)) return;

	std::cout << "New fiber bundle assigned" << std::endl;

	if (mBundle)
	{
		disconnect(mBundle.get(), SIGNAL(transformChanged()), this, SLOT(bundleTransformChanged()));
		disconnect(mBundle.get(), SIGNAL(meshChanged()), this, SLOT(bundleChanged()));
	}

	mBundle = bundle;

	if (mBundle)
	{
		connect(mBundle.get(), SIGNAL(transformChanged()), this, SLOT(bundleTransformChanged()));
		connect(mBundle.get(), SIGNAL(meshChanged()), this, SLOT(bundleChanged()));
	}

	bundleChanged();
	this->bundleTransformChanged();
}
Example #11
0
void
FeatureFloodCount::initialSetup()
{
  // Get a pointer to the PeriodicBoundaries buried in libMesh
  _pbs = _fe_problem.getNonlinearSystemBase().dofMap().get_periodic_boundaries();

  meshChanged();

  /**
   * Size the empty var to features vector to the number of coupled variables.
   * This empty vector (but properly sized) vector is returned for elements
   * that are queried but are not in the structure (which also shouldn't happen).
   * The user is warned in this case but this helps avoid extra bounds checking
   * in user code and avoids segfaults.
   */
  _empty_var_to_features.resize(_n_vars, invalid_id);
}
Example #12
0
void MeshEditor::loadCustom()
{
	if (meshBox->count() > 0) {
		QFileDialog dialog(this, tr("Open File"));
		dialog.exec();

		QString filename = dialog.selectedFiles().first();
		if (!filename.isNull()) {
			pg::Plant *plant = editor->getPlant();
			int id = meshBox->currentData().toInt();
			pg::Geometry geom = plant->getLeafMesh(id);
			File file;
			std::string s = filename.toStdString();
			file.importObj(s.c_str(), &geom);
			plant->addLeafMesh(geom);
			emit meshChanged(geom);
			editor->change();
		}
	}
}
Example #13
0
void QOutlet::onMeshChanged    (const String& name, const MeshConstPtr& value) { emit    meshChanged(name, value); }
Example #14
0
void
Nemesis::initialSetup()
{
  // Make certain that a Nemesis_IO object exists
  meshChanged();
}
Example #15
0
void
ActuallyExplicitEuler::initialSetup()
{
  meshChanged();
}