mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
System : Replaced tab with four spaces in AppFwk
This commit is contained in:
parent
4de95c2092
commit
fb55b469a0
@ -50,7 +50,7 @@ namespace caf {
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Log::info(const QString& msg)
|
||||
{
|
||||
infoMultiLine(msg, "");
|
||||
infoMultiLine(msg, "");
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ void Log::info(const QString& msg)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Log::warning(const QString& msg)
|
||||
{
|
||||
warningMultiLine(msg, "");
|
||||
warningMultiLine(msg, "");
|
||||
}
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ void Log::warning(const QString& msg)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool Log::error(const QString& err)
|
||||
{
|
||||
return errorMultiLine(err, "");
|
||||
return errorMultiLine(err, "");
|
||||
}
|
||||
|
||||
|
||||
@ -77,30 +77,30 @@ bool Log::error(const QString& err)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Log::infoMultiLine(const QString& line1, const QString& line2Etc)
|
||||
{
|
||||
MessagePanel* messagePanel = MessagePanel::instance();
|
||||
MessagePanel* messagePanel = MessagePanel::instance();
|
||||
|
||||
bool generateTrace = true;
|
||||
bool generateTrace = true;
|
||||
|
||||
if (messagePanel)
|
||||
{
|
||||
QString msg = line1;
|
||||
if (!line2Etc.isEmpty())
|
||||
{
|
||||
msg += "\n";
|
||||
if (messagePanel)
|
||||
{
|
||||
QString msg = line1;
|
||||
if (!line2Etc.isEmpty())
|
||||
{
|
||||
msg += "\n";
|
||||
msg += Utils::indentString(2, line2Etc);
|
||||
}
|
||||
}
|
||||
|
||||
messagePanel->showInfo(msg);
|
||||
}
|
||||
messagePanel->showInfo(msg);
|
||||
}
|
||||
|
||||
if (generateTrace)
|
||||
{
|
||||
if (generateTrace)
|
||||
{
|
||||
cvf::Trace::show("INF: %s", (const char*)line1.toAscii());
|
||||
if (!line2Etc.isEmpty())
|
||||
{
|
||||
if (!line2Etc.isEmpty())
|
||||
{
|
||||
cvf::Trace::show((const char*)Utils::indentString(5, line2Etc).toAscii());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -146,7 +146,7 @@ bool Log::errorMultiLine(const QString& line1, const QString& line2Etc)
|
||||
bool generateTrace = true;
|
||||
|
||||
if (messagePanel)
|
||||
{
|
||||
{
|
||||
QString msg = line1;
|
||||
if (!line2Etc.isEmpty())
|
||||
{
|
||||
@ -155,43 +155,43 @@ bool Log::errorMultiLine(const QString& line1, const QString& line2Etc)
|
||||
}
|
||||
|
||||
messagePanel->showError(msg);
|
||||
}
|
||||
}
|
||||
|
||||
bool messagePanelVisible = messagePanel ? messagePanel->isVisibleToUser() : false;
|
||||
if (!messagePanelVisible)
|
||||
{
|
||||
// if (mainWindow)
|
||||
// {
|
||||
// QString capt = QString(PD_APPLICATION_NAME) + " Error";
|
||||
bool messagePanelVisible = messagePanel ? messagePanel->isVisibleToUser() : false;
|
||||
if (!messagePanelVisible)
|
||||
{
|
||||
// if (mainWindow)
|
||||
// {
|
||||
// QString capt = QString(PD_APPLICATION_NAME) + " Error";
|
||||
//
|
||||
// QString msg = line1;
|
||||
// if (!line2Etc.isEmpty())
|
||||
// {
|
||||
// msg += "\n";
|
||||
// msg += line2Etc;
|
||||
// }
|
||||
// QString msg = line1;
|
||||
// if (!line2Etc.isEmpty())
|
||||
// {
|
||||
// msg += "\n";
|
||||
// msg += line2Etc;
|
||||
// }
|
||||
//
|
||||
// QMessageBox msgBox(mainWindow);
|
||||
// msgBox.setIcon(QMessageBox::Critical);
|
||||
// msgBox.setWindowTitle(capt);
|
||||
// msgBox.setText(msg);
|
||||
// QMessageBox msgBox(mainWindow);
|
||||
// msgBox.setIcon(QMessageBox::Critical);
|
||||
// msgBox.setWindowTitle(capt);
|
||||
// msgBox.setText(msg);
|
||||
//
|
||||
// msgBox.exec();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// generateTrace = true;
|
||||
// }
|
||||
}
|
||||
// msgBox.exec();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// generateTrace = true;
|
||||
// }
|
||||
}
|
||||
|
||||
if (generateTrace)
|
||||
{
|
||||
if (generateTrace)
|
||||
{
|
||||
cvf::Trace::show("\nERR: %s", (const char*)line1.toAscii());
|
||||
if (!line2Etc.isEmpty())
|
||||
{
|
||||
cvf::Trace::show((const char*)Utils::indentString(5, line2Etc).toAscii());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
static void warningMultiLine(const QString& line1, const QString& line2Etc);
|
||||
static bool errorMultiLine(const QString& line1, const QString& line2Etc);
|
||||
|
||||
static void pumpMessages();
|
||||
static void pumpMessages();
|
||||
};
|
||||
|
||||
|
||||
|
@ -61,13 +61,13 @@ MessagePanel* MessagePanel::sm_messagePanelInstance = NULL;
|
||||
MessagePanel::MessagePanel(QDockWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
m_textEdit = new QTextEdit(this);
|
||||
m_textEdit->setReadOnly(true);
|
||||
m_textEdit->setLineWrapMode(QTextEdit::NoWrap);
|
||||
m_textEdit = new QTextEdit(this);
|
||||
m_textEdit->setReadOnly(true);
|
||||
m_textEdit->setLineWrapMode(QTextEdit::NoWrap);
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout();
|
||||
layout->addWidget(m_textEdit);
|
||||
setLayout(layout);
|
||||
QVBoxLayout* layout = new QVBoxLayout();
|
||||
layout->addWidget(m_textEdit);
|
||||
setLayout(layout);
|
||||
|
||||
sm_messagePanelInstance = this;
|
||||
}
|
||||
@ -78,13 +78,13 @@ MessagePanel::MessagePanel(QDockWidget* parent)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void MessagePanel::showInfo(QString info)
|
||||
{
|
||||
convertStringToHTML(&info);
|
||||
convertStringToHTML(&info);
|
||||
|
||||
QString str = "<font color='green'>";
|
||||
str += info;
|
||||
str += "</font>";
|
||||
QString str = "<font color='green'>";
|
||||
str += info;
|
||||
str += "</font>";
|
||||
|
||||
m_textEdit->append(str);
|
||||
m_textEdit->append(str);
|
||||
}
|
||||
|
||||
|
||||
@ -93,13 +93,13 @@ void MessagePanel::showInfo(QString info)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void MessagePanel::showWarning(QString warn)
|
||||
{
|
||||
convertStringToHTML(&warn);
|
||||
convertStringToHTML(&warn);
|
||||
|
||||
QString str = "<font color='maroon'>";
|
||||
str += warn;
|
||||
str += "</font>";
|
||||
|
||||
m_textEdit->append(str);
|
||||
QString str = "<font color='maroon'>";
|
||||
str += warn;
|
||||
str += "</font>";
|
||||
|
||||
m_textEdit->append(str);
|
||||
}
|
||||
|
||||
|
||||
@ -108,13 +108,13 @@ void MessagePanel::showWarning(QString warn)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void MessagePanel::showError(QString error)
|
||||
{
|
||||
convertStringToHTML(&error);
|
||||
convertStringToHTML(&error);
|
||||
|
||||
QString str = "<b><font color='red'>";
|
||||
str += error;
|
||||
str += "</font></b>";
|
||||
QString str = "<b><font color='red'>";
|
||||
str += error;
|
||||
str += "</font></b>";
|
||||
|
||||
m_textEdit->append(str);
|
||||
m_textEdit->append(str);
|
||||
}
|
||||
|
||||
|
||||
@ -123,8 +123,8 @@ void MessagePanel::showError(QString error)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void MessagePanel::convertStringToHTML(QString* str)
|
||||
{
|
||||
str->replace("\n", "<br>");
|
||||
str->replace(" ", " ");
|
||||
str->replace("\n", "<br>");
|
||||
str->replace(" ", " ");
|
||||
}
|
||||
|
||||
|
||||
@ -143,15 +143,15 @@ QSize MessagePanel::sizeHint () const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool MessagePanel::isVisibleToUser()
|
||||
{
|
||||
if (!isVisible()) return false;
|
||||
if (!isVisible()) return false;
|
||||
|
||||
if (!m_textEdit) return false;
|
||||
if (!m_textEdit->isVisible()) return false;
|
||||
if (!m_textEdit) return false;
|
||||
if (!m_textEdit->isVisible()) return false;
|
||||
|
||||
QRegion rgn = m_textEdit->visibleRegion();
|
||||
if (rgn.isEmpty()) return false;
|
||||
QRegion rgn = m_textEdit->visibleRegion();
|
||||
if (rgn.isEmpty()) return false;
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -52,27 +52,27 @@ namespace caf {
|
||||
//==================================================================================================
|
||||
class MessagePanel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MessagePanel(QDockWidget* parent);
|
||||
MessagePanel(QDockWidget* parent);
|
||||
|
||||
static MessagePanel* instance();
|
||||
|
||||
void showInfo(QString info);
|
||||
void showWarning(QString warn);
|
||||
void showError(QString error);
|
||||
void showInfo(QString info);
|
||||
void showWarning(QString warn);
|
||||
void showError(QString error);
|
||||
|
||||
virtual QSize sizeHint () const;
|
||||
bool isVisibleToUser();
|
||||
virtual QSize sizeHint () const;
|
||||
bool isVisibleToUser();
|
||||
|
||||
private:
|
||||
static void convertStringToHTML(QString* str);
|
||||
static void convertStringToHTML(QString* str);
|
||||
|
||||
private:
|
||||
static MessagePanel* sm_messagePanelInstance;
|
||||
|
||||
QTextEdit* m_textEdit;
|
||||
QTextEdit* m_textEdit;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ namespace caf {
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QtMouseState::QtMouseState()
|
||||
{
|
||||
m_cleanButtonClickTolerance = 3;
|
||||
m_cleanButtonClickTolerance = 3;
|
||||
|
||||
reset();
|
||||
}
|
||||
@ -200,12 +200,12 @@ void QtMouseState::updateFromMouseEvent(QGraphicsSceneMouseEvent* event)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void QtMouseState::reset()
|
||||
{
|
||||
m_mouseButtonState = Qt::NoButton;
|
||||
m_mouseButtonState = Qt::NoButton;
|
||||
|
||||
m_cleanButtonPressButton = Qt::NoButton;
|
||||
m_cleanButtonPressPosX = cvf::UNDEFINED_INT;
|
||||
m_cleanButtonPressButton = Qt::NoButton;
|
||||
m_cleanButtonPressPosX = cvf::UNDEFINED_INT;
|
||||
m_cleanButtonPressPosY = cvf::UNDEFINED_INT;
|
||||
m_cleanButtonClickButton = Qt::NoButton;
|
||||
m_cleanButtonClickButton = Qt::NoButton;
|
||||
}
|
||||
|
||||
|
||||
@ -214,7 +214,7 @@ void QtMouseState::reset()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Qt::MouseButtons QtMouseState::mouseButtonState() const
|
||||
{
|
||||
return m_mouseButtonState;
|
||||
return m_mouseButtonState;
|
||||
}
|
||||
|
||||
|
||||
@ -223,7 +223,7 @@ Qt::MouseButtons QtMouseState::mouseButtonState() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Qt::KeyboardModifiers QtMouseState::keyboardModifierFlags() const
|
||||
{
|
||||
return m_keyboardModifierFlags;
|
||||
return m_keyboardModifierFlags;
|
||||
}
|
||||
|
||||
|
||||
@ -232,7 +232,7 @@ Qt::KeyboardModifiers QtMouseState::keyboardModifierFlags() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Qt::MouseButton QtMouseState::cleanButtonClickButton() const
|
||||
{
|
||||
return m_cleanButtonClickButton;
|
||||
return m_cleanButtonClickButton;
|
||||
}
|
||||
|
||||
|
||||
@ -241,13 +241,13 @@ Qt::MouseButton QtMouseState::cleanButtonClickButton() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int QtMouseState::numMouseButtonsInState(Qt::MouseButtons buttonState)
|
||||
{
|
||||
int iNum = 0;
|
||||
int iNum = 0;
|
||||
|
||||
if (buttonState & Qt::LeftButton) iNum++;
|
||||
if (buttonState & Qt::RightButton) iNum++;
|
||||
if (buttonState & Qt::MidButton) iNum++;
|
||||
if (buttonState & Qt::LeftButton) iNum++;
|
||||
if (buttonState & Qt::RightButton) iNum++;
|
||||
if (buttonState & Qt::MidButton) iNum++;
|
||||
|
||||
return iNum;
|
||||
return iNum;
|
||||
}
|
||||
|
||||
|
||||
|
@ -126,12 +126,12 @@ QString Utils::constructFullFileName(const QString& folder, const QString& baseF
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString Utils::indentString(int numSpacesToIndent, const QString& str)
|
||||
{
|
||||
QString indentString;
|
||||
indentString.fill(' ', numSpacesToIndent);
|
||||
QString indentString;
|
||||
indentString.fill(' ', numSpacesToIndent);
|
||||
|
||||
QStringList strList = str.split("\n");
|
||||
QStringList strList = str.split("\n");
|
||||
|
||||
QString retStr = indentString + strList.join("\n" + indentString);
|
||||
QString retStr = indentString + strList.join("\n" + indentString);
|
||||
return retStr;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ QString CmdFieldChangeExec::name()
|
||||
{
|
||||
QString fieldText;
|
||||
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
fieldText = QString("Change field '%1'").arg(uiFieldHandle->uiName());
|
||||
@ -91,8 +91,8 @@ void CmdFieldChangeExec::redo()
|
||||
return;
|
||||
}
|
||||
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
PdmXmlFieldHandle* xmlFieldHandle = field->xmlCapability();
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
PdmXmlFieldHandle* xmlFieldHandle = field->xmlCapability();
|
||||
if (uiFieldHandle && xmlFieldHandle)
|
||||
{
|
||||
if (m_commandData->m_redoFieldValueSerialized.isEmpty())
|
||||
@ -140,8 +140,8 @@ void CmdFieldChangeExec::undo()
|
||||
return;
|
||||
}
|
||||
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
PdmXmlFieldHandle* xmlFieldHandle = field->xmlCapability();
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
PdmXmlFieldHandle* xmlFieldHandle = field->xmlCapability();
|
||||
if (uiFieldHandle && xmlFieldHandle)
|
||||
{
|
||||
QXmlStreamReader xmlStream(m_commandData->m_undoFieldValueSerialized);
|
||||
|
@ -109,7 +109,7 @@ void CmdUiCommandSystemImpl::fieldChangedCommand(PdmFieldHandle* editorField, co
|
||||
for (size_t i = 0; i < fieldsToUpdate.size(); i++)
|
||||
{
|
||||
PdmFieldHandle* field = fieldsToUpdate[i];
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
QVariant fieldCurrentUiValue = uiFieldHandle->uiValue();
|
||||
|
@ -79,7 +79,7 @@ void CmdAddItemExec::redo()
|
||||
PdmChildArrayFieldHandle* listField = dynamic_cast<PdmChildArrayFieldHandle*>(field);
|
||||
if (listField && field->xmlCapability())
|
||||
{
|
||||
QString classKeyword = field->xmlCapability()->childClassKeyword();
|
||||
QString classKeyword = field->xmlCapability()->childClassKeyword();
|
||||
|
||||
if (classKeyword.isEmpty()) return;
|
||||
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
// Access operators
|
||||
|
||||
/*Conversion*/ operator DataType* () const { return m_fieldValue; }
|
||||
DataType* operator->() const { return m_fieldValue; }
|
||||
DataType* operator->() const { return m_fieldValue; }
|
||||
|
||||
const PdmPointer<DataType>& operator()() const { return m_fieldValue; }
|
||||
const PdmPointer<DataType>& v() const { return m_fieldValue; }
|
||||
|
@ -72,12 +72,12 @@ bool PdmFieldHandle::hasPtrReferencedObjects()
|
||||
/*
|
||||
PdmUiFieldHandle* PdmFieldHandle::uiCapability()
|
||||
{
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PdmXmlFieldHandle* PdmFieldHandle::xmlCapability()
|
||||
{
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -41,8 +41,8 @@ public:
|
||||
template <typename CapabilityType>
|
||||
CapabilityType* capability();
|
||||
|
||||
PdmUiFieldHandle* uiCapability();
|
||||
PdmXmlFieldHandle* xmlCapability();
|
||||
PdmUiFieldHandle* uiCapability();
|
||||
PdmXmlFieldHandle* xmlCapability();
|
||||
|
||||
private:
|
||||
PDM_DISABLE_COPY_AND_ASSIGN(PdmFieldHandle);
|
||||
|
@ -42,9 +42,9 @@ void PdmObjectHandle::fields(std::vector<PdmFieldHandle*>& fields) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmObjectHandle::setAsParentField(PdmFieldHandle* parentField)
|
||||
{
|
||||
assert(m_parentField == NULL);
|
||||
assert(m_parentField == NULL);
|
||||
|
||||
m_parentField = parentField;
|
||||
m_parentField = parentField;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -52,9 +52,9 @@ void PdmObjectHandle::setAsParentField(PdmFieldHandle* parentField)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmObjectHandle::removeAsParentField(PdmFieldHandle* parentField)
|
||||
{
|
||||
assert(m_parentField == parentField);
|
||||
assert(m_parentField == parentField);
|
||||
|
||||
m_parentField = NULL;
|
||||
m_parentField = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -84,12 +84,12 @@ public :
|
||||
{ PdmPointerImpl::addReference(&m_object); }
|
||||
inline ~PdmPointer () { PdmPointerImpl::removeReference(&m_object); }
|
||||
|
||||
T* p() const { return static_cast<T*>(const_cast<PdmObjectHandle*>(m_object)); }
|
||||
bool isNull() const { return !m_object; }
|
||||
bool notNull() const { return !isNull(); }
|
||||
T* p() const { return static_cast<T*>(const_cast<PdmObjectHandle*>(m_object)); }
|
||||
bool isNull() const { return !m_object; }
|
||||
bool notNull() const { return !isNull(); }
|
||||
operator T* () const { return static_cast<T*>(const_cast<PdmObjectHandle*>(m_object)); }
|
||||
T& operator* () const { return *static_cast<T*>(const_cast<PdmObjectHandle*>(m_object)); }
|
||||
T* operator->() const { return static_cast<T*>(const_cast<PdmObjectHandle*>(m_object)); }
|
||||
T& operator* () const { return *static_cast<T*>(const_cast<PdmObjectHandle*>(m_object)); }
|
||||
T* operator->() const { return static_cast<T*>(const_cast<PdmObjectHandle*>(m_object)); }
|
||||
PdmPointer<T> & operator= ( const PdmPointer<T>& p ) { if (this != &p) PdmPointerImpl::removeReference(&m_object); m_object = p.m_object; PdmPointerImpl::addReference(&m_object); return *this; }
|
||||
PdmPointer<T> & operator= ( T* p ) { if (m_object != p) PdmPointerImpl::removeReference(&m_object); m_object = p; PdmPointerImpl::addReference(&m_object); return *this; }
|
||||
|
||||
|
@ -54,16 +54,16 @@ public:
|
||||
// Access operators
|
||||
|
||||
/*Conversion*/ operator DataType* () const { return m_fieldValue; }
|
||||
DataType* operator->() const { return m_fieldValue; }
|
||||
DataType* operator->() const { return m_fieldValue; }
|
||||
|
||||
const PdmPointer<DataType>& operator()() const { return m_fieldValue; }
|
||||
const PdmPointer<DataType>& v() const { return m_fieldValue; }
|
||||
|
||||
bool operator==(const DataTypePtr& fieldValue) { return m_fieldValue == fieldValue; }
|
||||
|
||||
// Child objects
|
||||
|
||||
virtual void childObjects(std::vector<PdmObjectHandle*>*);
|
||||
// Child objects
|
||||
|
||||
virtual void childObjects(std::vector<PdmObjectHandle*>*);
|
||||
|
||||
// Ptr referenced objects
|
||||
|
||||
@ -76,7 +76,7 @@ private:
|
||||
friend class PdmFieldXmlCap< PdmPtrField <DataType*> >;
|
||||
void setRawPtr(PdmObjectHandle* obj);
|
||||
|
||||
PdmPointer<DataType> m_fieldValue;
|
||||
PdmPointer<DataType> m_fieldValue;
|
||||
|
||||
// Resolving
|
||||
QString m_referenceString;
|
||||
|
@ -79,12 +79,12 @@ caf::PdmPtrField<DataType*>& PdmPtrField<DataType*>::operator=(const FieldDataTy
|
||||
template<typename DataType >
|
||||
void caf::PdmPtrField<DataType*>::childObjects(std::vector<PdmObjectHandle*>* objects)
|
||||
{
|
||||
assert(objects);
|
||||
PdmObjectHandle* obj = m_fieldValue.rawPtr();
|
||||
if (obj)
|
||||
{
|
||||
objects->push_back(obj);
|
||||
}
|
||||
assert(objects);
|
||||
PdmObjectHandle* obj = m_fieldValue.rawPtr();
|
||||
if (obj)
|
||||
{
|
||||
objects->push_back(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -154,7 +154,7 @@ public:
|
||||
{
|
||||
addField(field, keyword);
|
||||
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
uiFieldHandle->setUiItemInfo(fieldDescription);
|
||||
|
@ -45,10 +45,10 @@ void PdmUiFieldHandle::notifyFieldChanged(const QVariant& oldFieldValue, const Q
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiFieldHandle* PdmFieldHandle::uiCapability()
|
||||
{
|
||||
PdmUiFieldHandle* uiField = capability<PdmUiFieldHandle>();
|
||||
assert(uiField);
|
||||
PdmUiFieldHandle* uiField = capability<PdmUiFieldHandle>();
|
||||
assert(uiField);
|
||||
|
||||
return uiField;
|
||||
return uiField;
|
||||
}
|
||||
|
||||
} // End of namespace caf
|
||||
|
@ -47,7 +47,7 @@ void PdmUiObjectHandle::uiOrdering(QString uiConfigName, PdmUiOrdering& uiOrderi
|
||||
m_owner->fields(fields);
|
||||
for (size_t i = 0; i < fields.size(); ++i)
|
||||
{
|
||||
PdmUiFieldHandle * field = fields[i]->uiCapability();
|
||||
PdmUiFieldHandle * field = fields[i]->uiCapability();
|
||||
if (!uiOrdering.contains(field))
|
||||
{
|
||||
uiOrdering.add(field->fieldHandle());
|
||||
@ -114,7 +114,7 @@ void PdmUiObjectHandle::addDefaultUiTreeChildren(PdmUiTreeOrdering* uiTreeOrderi
|
||||
{
|
||||
if (fields[fIdx]->hasChildObjects() && !uiTreeOrdering->containsField(fields[fIdx]))
|
||||
{
|
||||
if (fields[fIdx]->uiCapability()->isUiHidden() && !fields[fIdx]->uiCapability()->isUiChildrenHidden())
|
||||
if (fields[fIdx]->uiCapability()->isUiHidden() && !fields[fIdx]->uiCapability()->isUiChildrenHidden())
|
||||
{
|
||||
std::vector<PdmObjectHandle*> children;
|
||||
fields[fIdx]->childObjects(&children);
|
||||
@ -147,7 +147,7 @@ void PdmUiObjectHandle::addDefaultUiTreeChildren(PdmUiTreeOrdering* uiTreeOrderi
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!fields[fIdx]->uiCapability()->isUiHidden())
|
||||
else if (!fields[fIdx]->uiCapability()->isUiHidden())
|
||||
{
|
||||
uiTreeOrdering->add(fields[fIdx]);
|
||||
}
|
||||
@ -182,7 +182,7 @@ void PdmUiObjectHandle::expandUiTree(PdmUiTreeOrdering* root, QString uiConfigNa
|
||||
{
|
||||
if (!root->ignoreSubTree())
|
||||
{
|
||||
if (root->isRepresentingField() && !root->field()->uiCapability()->isUiChildrenHidden(uiConfigName))
|
||||
if (root->isRepresentingField() && !root->field()->uiCapability()->isUiChildrenHidden(uiConfigName))
|
||||
{
|
||||
std::vector<PdmObjectHandle*> fieldsChildObjects;
|
||||
root->field()->childObjects(&fieldsChildObjects);
|
||||
@ -216,7 +216,7 @@ void PdmUiObjectHandle::updateUiIconFromToggleField()
|
||||
{
|
||||
if (objectToggleField())
|
||||
{
|
||||
PdmUiFieldHandle* uiFieldHandle = objectToggleField()->uiCapability();
|
||||
PdmUiFieldHandle* uiFieldHandle = objectToggleField()->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
bool active = uiFieldHandle->uiValue().toBool();
|
||||
|
@ -93,7 +93,7 @@ bool PdmUiOrdering::contains(const PdmUiItem* item)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiOrdering::add(const PdmFieldHandle* field)
|
||||
{
|
||||
PdmUiFieldHandle* uiItem = const_cast<PdmFieldHandle*>(field)->uiCapability();
|
||||
PdmUiFieldHandle* uiItem = const_cast<PdmFieldHandle*>(field)->uiCapability();
|
||||
assert(uiItem);
|
||||
m_ordering.push_back(uiItem);
|
||||
}
|
||||
|
@ -256,8 +256,8 @@ PdmUiItem* PdmUiTreeOrdering::uiItem() const
|
||||
PdmUiItem* PdmUiTreeOrdering::activeItem() const
|
||||
{
|
||||
if (isRepresentingObject()) return uiObj(m_object);
|
||||
if (isRepresentingField()) return m_field->uiCapability();
|
||||
if (isDisplayItemOnly()) return m_uiItem;
|
||||
if (isRepresentingField()) return m_field->uiCapability();
|
||||
if (isDisplayItemOnly()) return m_uiItem;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -154,17 +154,17 @@ void SelectionManager::selectionAsReferences(std::vector<QString>& referenceList
|
||||
|
||||
for (size_t i = 0; i < selection.size(); i++)
|
||||
{
|
||||
if (!selection[i].first.isNull())
|
||||
{
|
||||
PdmUiObjectHandle* pdmObj = dynamic_cast<PdmUiObjectHandle*>(selection[i].second);
|
||||
if (pdmObj)
|
||||
{
|
||||
QString itemRef = PdmReferenceHelper::referenceFromRootToObject(m_rootObject, pdmObj->objectHandle());
|
||||
if (!selection[i].first.isNull())
|
||||
{
|
||||
PdmUiObjectHandle* pdmObj = dynamic_cast<PdmUiObjectHandle*>(selection[i].second);
|
||||
if (pdmObj)
|
||||
{
|
||||
QString itemRef = PdmReferenceHelper::referenceFromRootToObject(m_rootObject, pdmObj->objectHandle());
|
||||
|
||||
referenceList.push_back(itemRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
referenceList.push_back(itemRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -57,39 +57,39 @@ void PdmSettings::readFieldsFromApplicationStore(caf::PdmObjectHandle* object, c
|
||||
// Constructs a QSettings object for accessing settings of the application and organization
|
||||
// set previously with a call to QCoreApplication::setOrganizationName(),
|
||||
// QCoreApplication::setOrganizationDomain(), and QCoreApplication::setApplicationName().
|
||||
QSettings settings;
|
||||
std::vector<caf::PdmFieldHandle*> fields;
|
||||
QSettings settings;
|
||||
std::vector<caf::PdmFieldHandle*> fields;
|
||||
|
||||
object->fields(fields);
|
||||
size_t i;
|
||||
for (i = 0; i < fields.size(); i++)
|
||||
{
|
||||
caf::PdmFieldHandle* fieldHandle = fields[i];
|
||||
object->fields(fields);
|
||||
size_t i;
|
||||
for (i = 0; i < fields.size(); i++)
|
||||
{
|
||||
caf::PdmFieldHandle* fieldHandle = fields[i];
|
||||
|
||||
std::vector<caf::PdmObjectHandle*> children;
|
||||
fieldHandle->childObjects(&children);
|
||||
for (size_t childIdx = 0; childIdx < children.size(); childIdx++)
|
||||
{
|
||||
caf::PdmObjectHandle* child = children[childIdx];
|
||||
caf::PdmXmlObjectHandle* xmlObjHandle = xmlObj(child);
|
||||
std::vector<caf::PdmObjectHandle*> children;
|
||||
fieldHandle->childObjects(&children);
|
||||
for (size_t childIdx = 0; childIdx < children.size(); childIdx++)
|
||||
{
|
||||
caf::PdmObjectHandle* child = children[childIdx];
|
||||
caf::PdmXmlObjectHandle* xmlObjHandle = xmlObj(child);
|
||||
|
||||
QString subContext = context + xmlObjHandle->classKeyword() + "/";
|
||||
readFieldsFromApplicationStore(child, subContext);
|
||||
}
|
||||
QString subContext = context + xmlObjHandle->classKeyword() + "/";
|
||||
readFieldsFromApplicationStore(child, subContext);
|
||||
}
|
||||
|
||||
if (children.size() == 0)
|
||||
{
|
||||
QString key = context + fieldHandle->keyword();
|
||||
if (settings.contains(key))
|
||||
{
|
||||
QVariant val = settings.value(key);
|
||||
if (children.size() == 0)
|
||||
{
|
||||
QString key = context + fieldHandle->keyword();
|
||||
if (settings.contains(key))
|
||||
{
|
||||
QVariant val = settings.value(key);
|
||||
|
||||
caf::PdmValueField* valueField = dynamic_cast<caf::PdmValueField*>(fieldHandle);
|
||||
assert(valueField);
|
||||
valueField->setFromQVariant(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
caf::PdmValueField* valueField = dynamic_cast<caf::PdmValueField*>(fieldHandle);
|
||||
assert(valueField);
|
||||
valueField->setFromQVariant(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -104,39 +104,39 @@ void PdmSettings::writeFieldsToApplicationStore(caf::PdmObjectHandle* object, co
|
||||
// Constructs a QSettings object for accessing settings of the application and organization
|
||||
// set previously with a call to QCoreApplication::setOrganizationName(),
|
||||
// QCoreApplication::setOrganizationDomain(), and QCoreApplication::setApplicationName().
|
||||
QSettings settings;
|
||||
QSettings settings;
|
||||
|
||||
std::vector<caf::PdmFieldHandle*> fields;
|
||||
object->fields(fields);
|
||||
std::vector<caf::PdmFieldHandle*> fields;
|
||||
object->fields(fields);
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < fields.size(); i++)
|
||||
{
|
||||
caf::PdmFieldHandle* fieldHandle = fields[i];
|
||||
size_t i;
|
||||
for (i = 0; i < fields.size(); i++)
|
||||
{
|
||||
caf::PdmFieldHandle* fieldHandle = fields[i];
|
||||
|
||||
std::vector<caf::PdmObjectHandle*> children;
|
||||
fieldHandle->childObjects(&children);
|
||||
for (size_t childIdx = 0; childIdx < children.size(); childIdx++)
|
||||
{
|
||||
caf::PdmObjectHandle* child = children[childIdx];
|
||||
QString subContext;
|
||||
if (context.isEmpty())
|
||||
{
|
||||
caf::PdmXmlObjectHandle* xmlObjHandle = xmlObj(child);
|
||||
std::vector<caf::PdmObjectHandle*> children;
|
||||
fieldHandle->childObjects(&children);
|
||||
for (size_t childIdx = 0; childIdx < children.size(); childIdx++)
|
||||
{
|
||||
caf::PdmObjectHandle* child = children[childIdx];
|
||||
QString subContext;
|
||||
if (context.isEmpty())
|
||||
{
|
||||
caf::PdmXmlObjectHandle* xmlObjHandle = xmlObj(child);
|
||||
|
||||
subContext = xmlObjHandle->classKeyword() + "/";
|
||||
}
|
||||
subContext = xmlObjHandle->classKeyword() + "/";
|
||||
}
|
||||
|
||||
writeFieldsToApplicationStore(child, subContext);
|
||||
}
|
||||
writeFieldsToApplicationStore(child, subContext);
|
||||
}
|
||||
|
||||
if (children.size() == 0)
|
||||
{
|
||||
caf::PdmValueField* valueField = dynamic_cast<caf::PdmValueField*>(fieldHandle);
|
||||
assert(valueField);
|
||||
settings.setValue(context + fieldHandle->keyword(), valueField->toQVariant());
|
||||
}
|
||||
}
|
||||
if (children.size() == 0)
|
||||
{
|
||||
caf::PdmValueField* valueField = dynamic_cast<caf::PdmValueField*>(fieldHandle);
|
||||
assert(valueField);
|
||||
settings.setValue(context + fieldHandle->keyword(), valueField->toQVariant());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -47,8 +47,8 @@ namespace caf
|
||||
class PdmSettings
|
||||
{
|
||||
public:
|
||||
static void readFieldsFromApplicationStore(caf::PdmObjectHandle* object, const QString context = "");
|
||||
static void writeFieldsToApplicationStore(caf::PdmObjectHandle* object, const QString context = "");
|
||||
static void readFieldsFromApplicationStore(caf::PdmObjectHandle* object, const QString context = "");
|
||||
static void writeFieldsToApplicationStore(caf::PdmObjectHandle* object, const QString context = "");
|
||||
};
|
||||
|
||||
|
||||
|
@ -54,10 +54,10 @@ QString PdmXmlFieldHandle::childClassKeyword()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmXmlFieldHandle* PdmFieldHandle::xmlCapability()
|
||||
{
|
||||
PdmXmlFieldHandle* xmlField = capability<PdmXmlFieldHandle>();
|
||||
assert(xmlField);
|
||||
PdmXmlFieldHandle* xmlField = capability<PdmXmlFieldHandle>();
|
||||
assert(xmlField);
|
||||
|
||||
return xmlField;
|
||||
return xmlField;
|
||||
}
|
||||
|
||||
} // End of namespace caf
|
||||
|
@ -57,9 +57,9 @@ void PdmXmlObjectHandle::readFields(QXmlStreamReader& xmlStream, PdmObjectFactor
|
||||
QString name = xmlStream.name().toString();
|
||||
|
||||
PdmFieldHandle* fieldHandle = m_owner->findField(name);
|
||||
if (fieldHandle && fieldHandle->xmlCapability())
|
||||
if (fieldHandle && fieldHandle->xmlCapability())
|
||||
{
|
||||
PdmXmlFieldHandle* xmlFieldHandle = fieldHandle->xmlCapability();
|
||||
PdmXmlFieldHandle* xmlFieldHandle = fieldHandle->xmlCapability();
|
||||
if (xmlFieldHandle->isIOReadable())
|
||||
{
|
||||
// readFieldData assumes that the xmlStream points to first token of field content.
|
||||
@ -114,7 +114,7 @@ void PdmXmlObjectHandle::writeFields(QXmlStreamWriter& xmlStream)
|
||||
m_owner->fields(fields);
|
||||
for (size_t it = 0; it < fields.size(); ++it)
|
||||
{
|
||||
PdmXmlFieldHandle* field = fields[it]->xmlCapability();
|
||||
PdmXmlFieldHandle* field = fields[it]->xmlCapability();
|
||||
if (field && field->isIOWritable())
|
||||
{
|
||||
QString keyword = field->fieldHandle()->keyword();
|
||||
|
@ -68,82 +68,82 @@ cvf::Vec3d eigenVector3(const cvf::Mat3d& mx, double eigenValue, bool* computedO
|
||||
{
|
||||
const double doubleThreshold = 1.0e-60;
|
||||
if (computedOk) (*computedOk) = false;
|
||||
cvf::Mat3d mxMinusEigv = mx;
|
||||
cvf::Mat3d mxMinusEigv = mx;
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
mxMinusEigv(i, i) -= eigenValue;
|
||||
}
|
||||
|
||||
cvf::Mat3d cof = cofactor3(mxMinusEigv);
|
||||
cvf::Mat3d cof = cofactor3(mxMinusEigv);
|
||||
|
||||
// Find largest absolute cofactor
|
||||
// Find largest absolute cofactor
|
||||
|
||||
int largestCof_i = -1;
|
||||
int largestCof_i = -1;
|
||||
int largestCof_j = -1;
|
||||
double largestCof = 0.0;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
double absCof = fabs(cof(i,j));
|
||||
double largestCof = 0.0;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
double absCof = fabs(cof(i,j));
|
||||
|
||||
if (absCof > largestCof)
|
||||
{
|
||||
largestCof = absCof;
|
||||
largestCof_i = i;
|
||||
largestCof_j = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (absCof > largestCof)
|
||||
{
|
||||
largestCof = absCof;
|
||||
largestCof_i = i;
|
||||
largestCof_j = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fabs(largestCof) < doubleThreshold) return cvf::Vec3d::ZERO;
|
||||
if (fabs(largestCof) < doubleThreshold) return cvf::Vec3d::ZERO;
|
||||
|
||||
// Find largest matrix element not in the max cofactor row/col
|
||||
// Find largest matrix element not in the max cofactor row/col
|
||||
|
||||
int largestMxElm_i = -1;
|
||||
int largestMxElm_i = -1;
|
||||
int largestMxElm_j = -1;
|
||||
double largestMxElm = 0.0;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (i != largestCof_i)
|
||||
{
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
if (j != largestCof_j)
|
||||
{
|
||||
double absMxElm = fabs(mxMinusEigv(i,j));
|
||||
double largestMxElm = 0.0;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (i != largestCof_i)
|
||||
{
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
if (j != largestCof_j)
|
||||
{
|
||||
double absMxElm = fabs(mxMinusEigv(i,j));
|
||||
|
||||
if (absMxElm > largestMxElm)
|
||||
{
|
||||
largestMxElm = absMxElm;
|
||||
largestMxElm_i = i;
|
||||
largestMxElm_j = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (absMxElm > largestMxElm)
|
||||
{
|
||||
largestMxElm = absMxElm;
|
||||
largestMxElm_i = i;
|
||||
largestMxElm_j = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if largest coefficient is zero
|
||||
if (fabs(largestMxElm) < doubleThreshold) return cvf::Vec3d::ZERO;
|
||||
// Check if largest coefficient is zero
|
||||
if (fabs(largestMxElm) < doubleThreshold) return cvf::Vec3d::ZERO;
|
||||
|
||||
// Find last component index
|
||||
int lastComp_j = 0;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if ((i != largestCof_j) && (i != largestMxElm_j)) lastComp_j = i;
|
||||
}
|
||||
// Find last component index
|
||||
int lastComp_j = 0;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if ((i != largestCof_j) && (i != largestMxElm_j)) lastComp_j = i;
|
||||
}
|
||||
|
||||
cvf::Vec3d eigenVector;
|
||||
eigenVector[largestCof_j] = 1.0;
|
||||
eigenVector[lastComp_j] = cof(largestCof_i, lastComp_j) / cof(largestCof_i, largestCof_j);
|
||||
eigenVector[largestMxElm_j] = (-mxMinusEigv(largestMxElm_i, largestCof_j) - mxMinusEigv(largestMxElm_i, lastComp_j)*eigenVector[lastComp_j] )
|
||||
eigenVector[largestCof_j] = 1.0;
|
||||
eigenVector[lastComp_j] = cof(largestCof_i, lastComp_j) / cof(largestCof_i, largestCof_j);
|
||||
eigenVector[largestMxElm_j] = (-mxMinusEigv(largestMxElm_i, largestCof_j) - mxMinusEigv(largestMxElm_i, lastComp_j)*eigenVector[lastComp_j] )
|
||||
/ mxMinusEigv(largestMxElm_i, largestMxElm_j);
|
||||
|
||||
if (computedOk) (*computedOk) = true;
|
||||
|
||||
return eigenVector;
|
||||
return eigenVector;
|
||||
}
|
||||
|
||||
|
||||
|
@ -170,111 +170,111 @@ cvf::Vec3d eigenVector3(const cvf::Mat3d& mx, double eigenValue, bool* computedO
|
||||
template<typename S>
|
||||
cvf::Vec3f Tensor3<S>::calculatePrincipals( cvf::Vec3f principalDirections[3])
|
||||
{
|
||||
CVF_TIGHT_ASSERT(m_tensor);
|
||||
CVF_TIGHT_ASSERT(m_tensor);
|
||||
|
||||
const float floatThreshold = 1.0e-30f;
|
||||
const double doubleThreshold = 1.0e-60;
|
||||
|
||||
cvf::Vec3f principalValues;
|
||||
|
||||
// Init return arrays to invalid
|
||||
|
||||
// Init return arrays to invalid
|
||||
|
||||
principalValues[0] = std::numeric_limits<float>::infinity();
|
||||
principalValues[1] = std::numeric_limits<float>::infinity();
|
||||
principalValues[2] = std::numeric_limits<float>::infinity();
|
||||
|
||||
if (principalDirections)
|
||||
{
|
||||
principalDirections[0] = cvf::Vec3f::ZERO;
|
||||
principalDirections[1] = cvf::Vec3f::ZERO;
|
||||
principalDirections[2] = cvf::Vec3f::ZERO;
|
||||
}
|
||||
{
|
||||
principalDirections[0] = cvf::Vec3f::ZERO;
|
||||
principalDirections[1] = cvf::Vec3f::ZERO;
|
||||
principalDirections[2] = cvf::Vec3f::ZERO;
|
||||
}
|
||||
|
||||
// Return if we have an undefined component
|
||||
|
||||
int i;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
if (m_tensor[i] == std::numeric_limits<S>::infinity())
|
||||
int i;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
if (m_tensor[i] == std::numeric_limits<S>::infinity())
|
||||
{
|
||||
return principalValues;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return 0, 0, 0 if all components are zero
|
||||
// Return 0, 0, 0 if all components are zero
|
||||
|
||||
bool isAllTensCompsZero = true;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
if (!(abs(m_tensor[i]) < floatThreshold))
|
||||
{
|
||||
isAllTensCompsZero = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
bool isAllTensCompsZero = true;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
if (!(abs(m_tensor[i]) < floatThreshold))
|
||||
{
|
||||
isAllTensCompsZero = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isAllTensCompsZero)
|
||||
if (isAllTensCompsZero)
|
||||
{
|
||||
return cvf::Vec3f::ZERO;
|
||||
}
|
||||
|
||||
double SXX = m_tensor[0], SYY = m_tensor[1], SZZ = m_tensor[2];
|
||||
double SXY = m_tensor[3], SYZ = m_tensor[4], SZX = m_tensor[5];
|
||||
double SXX = m_tensor[0], SYY = m_tensor[1], SZZ = m_tensor[2];
|
||||
double SXY = m_tensor[3], SYZ = m_tensor[4], SZX = m_tensor[5];
|
||||
|
||||
double pressure = -(SXX + SYY + SZZ)/3.0;
|
||||
double pressure = -(SXX + SYY + SZZ)/3.0;
|
||||
|
||||
// Normally we would solve the eigenvalues by solving the 3'rd degree equation:
|
||||
// Normally we would solve the eigenvalues by solving the 3'rd degree equation:
|
||||
// -sigma^3 + A*sigma^2 - B*sigma + C = 0
|
||||
// in which A, B, and C are the invariants of the stress tensor.
|
||||
// in which A, B, and C are the invariants of the stress tensor.
|
||||
// http://www.engapplets.vt.edu/Mohr/java/nsfapplets/MohrCircles2-3D/Theory/theory.htm
|
||||
|
||||
// But the roots(eigenvalues) are calculated by transforming the above equation into
|
||||
// s**3 + aa*s + b = 0 and using the trignometric solution.
|
||||
// See crc standard mathematical tables 19th edition pp. 103-104.
|
||||
// But the roots(eigenvalues) are calculated by transforming the above equation into
|
||||
// s**3 + aa*s + b = 0 and using the trignometric solution.
|
||||
// See crc standard mathematical tables 19th edition pp. 103-104.
|
||||
|
||||
SXX += pressure;
|
||||
SYY += pressure;
|
||||
SZZ += pressure;
|
||||
SXX += pressure;
|
||||
SYY += pressure;
|
||||
SZZ += pressure;
|
||||
|
||||
double S1, S2, S3;
|
||||
double AA, BB, CC, DD, angleP;
|
||||
double AA, BB, CC, DD, angleP;
|
||||
|
||||
AA = SXY*SXY + SYZ*SYZ + SZX*SZX - SXX*SYY - SYY*SZZ - SXX*SZZ;
|
||||
AA = SXY*SXY + SYZ*SYZ + SZX*SZX - SXX*SYY - SYY*SZZ - SXX*SZZ;
|
||||
|
||||
BB = SXX * SYZ * SYZ
|
||||
BB = SXX * SYZ * SYZ
|
||||
+ SYY * SZX * SZX
|
||||
+ SZZ * SXY * SXY
|
||||
- SXX * SYY * SZZ
|
||||
- 2.0 * SXY * SYZ * SZX;
|
||||
|
||||
if (fabs(AA) < doubleThreshold)
|
||||
{
|
||||
S1 = 0.0;
|
||||
S2 = 0.0;
|
||||
S3 = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
CC = -sqrt(27.0/AA) * BB * 0.5 / AA;
|
||||
if (fabs(AA) < doubleThreshold)
|
||||
{
|
||||
S1 = 0.0;
|
||||
S2 = 0.0;
|
||||
S3 = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
CC = -sqrt(27.0/AA) * BB * 0.5 / AA;
|
||||
|
||||
if (CC > 1.0) CC = 1.0;
|
||||
else if (CC < -1.0) CC = -1.0;
|
||||
if (CC > 1.0) CC = 1.0;
|
||||
else if (CC < -1.0) CC = -1.0;
|
||||
|
||||
angleP = acos(CC)/3.0;
|
||||
DD = 2.0*sqrt(AA/3.0);
|
||||
S1 = DD*cos(angleP);
|
||||
S2 = DD*cos(angleP + 4.0*cvf::PI_D/3.0);
|
||||
S3 = DD*cos(angleP + 2.0*cvf::PI_D/3.0);
|
||||
}
|
||||
angleP = acos(CC)/3.0;
|
||||
DD = 2.0*sqrt(AA/3.0);
|
||||
S1 = DD*cos(angleP);
|
||||
S2 = DD*cos(angleP + 4.0*cvf::PI_D/3.0);
|
||||
S3 = DD*cos(angleP + 2.0*cvf::PI_D/3.0);
|
||||
}
|
||||
|
||||
int idxPMin = 2;
|
||||
int idxPMin = 2;
|
||||
int idxPMid = 1;
|
||||
int idxPMax = 0;
|
||||
|
||||
double principalsd[3];
|
||||
principalsd[idxPMax] = (S1 - pressure);
|
||||
principalsd[idxPMid] = (S2 - pressure);
|
||||
principalsd[idxPMin] = (S3 - pressure);
|
||||
double principalsd[3];
|
||||
principalsd[idxPMax] = (S1 - pressure);
|
||||
principalsd[idxPMid] = (S2 - pressure);
|
||||
principalsd[idxPMin] = (S3 - pressure);
|
||||
|
||||
// Sort the principals if we have no Z component in the tensor at all
|
||||
if ((m_tensor[2] == 0.0f) && (m_tensor[4] == 0.0f) && (m_tensor[5] == 0.0f))
|
||||
@ -317,8 +317,8 @@ template< typename S>
|
||||
float caf::Tensor3<S>::calculateVonMises()
|
||||
{
|
||||
return (float) sqrt( ( (m_tensor[0]*m_tensor[0] + m_tensor[1]*m_tensor[1] + m_tensor[2]*m_tensor[2]) ) +
|
||||
( -(m_tensor[0]*m_tensor[1] + m_tensor[1]*m_tensor[2] + m_tensor[0]*m_tensor[2]) ) +
|
||||
( 3*(m_tensor[3]*m_tensor[3] + m_tensor[4]*m_tensor[4] + m_tensor[5]*m_tensor[5]) ) );
|
||||
( -(m_tensor[0]*m_tensor[1] + m_tensor[1]*m_tensor[2] + m_tensor[0]*m_tensor[2]) ) +
|
||||
( 3*(m_tensor[3]*m_tensor[3] + m_tensor[4]*m_tensor[4] + m_tensor[5]*m_tensor[5]) ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -182,12 +182,12 @@ public:
|
||||
{
|
||||
if (uiObject->userDescriptionField())
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = uiObject->userDescriptionField()->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
userDesc = uiFieldHandle->uiValue().toString();
|
||||
}
|
||||
}
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = uiObject->userDescriptionField()->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
userDesc = uiFieldHandle->uiValue().toString();
|
||||
}
|
||||
}
|
||||
|
||||
options.push_back(caf::PdmOptionItemInfo(uiObject->uiName() + "(" + userDesc + ")", QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(objects[i]))));
|
||||
}
|
||||
@ -513,7 +513,7 @@ void MainWindow::setPdmRoot(caf::PdmObjectHandle* pdmRoot)
|
||||
if (fields.size())
|
||||
{
|
||||
caf::PdmFieldHandle* field = fields[0];
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
m_pdmUiTreeView2->setPdmItem(uiFieldHandle);
|
||||
|
@ -78,11 +78,11 @@ AboutDialog::AboutDialog(QWidget* parent)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Set application name to show in the dialog. Must be specified if any other app info is to be displayed
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void AboutDialog::setApplicationName(const QString& appName)
|
||||
void AboutDialog::setApplicationName(const QString& appName)
|
||||
{
|
||||
assert(!m_isCreated);
|
||||
m_appName = appName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -92,7 +92,7 @@ void AboutDialog::setApplicationVersion(const QString& ver)
|
||||
{
|
||||
assert(!m_isCreated);
|
||||
m_appVersion = ver;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -102,7 +102,7 @@ void AboutDialog::setCopyright(const QString& copyright)
|
||||
{
|
||||
assert(!m_isCreated);
|
||||
m_appCopyright = copyright;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -112,7 +112,7 @@ void AboutDialog::showQtVersion(bool show)
|
||||
{
|
||||
assert(!m_isCreated);
|
||||
m_showQtVersion = show;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -136,7 +136,7 @@ void AboutDialog::setIsDebugBuild(bool isDebugBuild)
|
||||
{
|
||||
assert(!m_isCreated);
|
||||
m_isDebugBuild = isDebugBuild;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -194,7 +194,7 @@ void AboutDialog::create()
|
||||
if (!m_appVersion.isEmpty())
|
||||
{
|
||||
QString appVer = m_appVersion;
|
||||
// appVer += cvf::System::is64Bit() ? " (64-bit)" : " (32-bit)";
|
||||
// appVer += cvf::System::is64Bit() ? " (64-bit)" : " (32-bit)";
|
||||
|
||||
QLabel* appVersionLabel = new QLabel(this);
|
||||
QFont appVersionFont(appVersionLabel->font());
|
||||
@ -228,7 +228,7 @@ void AboutDialog::create()
|
||||
|
||||
|
||||
// Possibly show extend version info
|
||||
if (m_showQtVersion ||
|
||||
if (m_showQtVersion ||
|
||||
m_verLabels.size() > 0)
|
||||
{
|
||||
QGridLayout* verInfoLayout = new QGridLayout;
|
||||
|
@ -54,33 +54,33 @@ class AboutDialog : public QDialog
|
||||
public:
|
||||
AboutDialog(QWidget* parent);
|
||||
|
||||
void setApplicationName(const QString& appName);
|
||||
void setApplicationVersion(const QString& ver);
|
||||
void setCopyright(const QString& copyright);
|
||||
void setApplicationName(const QString& appName);
|
||||
void setApplicationVersion(const QString& ver);
|
||||
void setCopyright(const QString& copyright);
|
||||
|
||||
void showQtVersion(bool show);
|
||||
void addVersionEntry(const QString& verLabel, const QString& verText);
|
||||
void setIsDebugBuild(bool isDebugBuild);
|
||||
void showQtVersion(bool show);
|
||||
void addVersionEntry(const QString& verLabel, const QString& verText);
|
||||
void setIsDebugBuild(bool isDebugBuild);
|
||||
|
||||
void create();
|
||||
void create();
|
||||
|
||||
static QString versionStringForcurrentOpenGLContext();
|
||||
|
||||
private:
|
||||
void addStringPairToVerInfoLayout(const QString& labelStr, const QString& infoStr, QGridLayout* verInfoLayout, int insertRow);
|
||||
void addStringPairToVerInfoLayout(const QString& labelStr, const QString& infoStr, QGridLayout* verInfoLayout, int insertRow);
|
||||
|
||||
private:
|
||||
bool m_isCreated; // Indicates if the create() function has been called
|
||||
bool m_isCreated; // Indicates if the create() function has been called
|
||||
|
||||
QString m_appName; // Application name, appears in bold at the top of the dialog.
|
||||
QString m_appVersion; // Application version info. Can be empty
|
||||
QString m_appCopyright; // Application copyright string. Can be empty
|
||||
QString m_appName; // Application name, appears in bold at the top of the dialog.
|
||||
QString m_appVersion; // Application version info. Can be empty
|
||||
QString m_appCopyright; // Application copyright string. Can be empty
|
||||
|
||||
bool m_showQtVersion; // Flags whether Qt version info should be shown
|
||||
QStringList m_verLabels; // Labels for user specified version entries
|
||||
QStringList m_verTexts; // The actual version text for user specified version entries
|
||||
bool m_showQtVersion; // Flags whether Qt version info should be shown
|
||||
QStringList m_verLabels; // Labels for user specified version entries
|
||||
QStringList m_verTexts; // The actual version text for user specified version entries
|
||||
|
||||
bool m_isDebugBuild; // If set to true, will show info in dlg to indicate that this is a debug build
|
||||
bool m_isDebugBuild; // If set to true, will show info in dlg to indicate that this is a debug build
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ void PdmUiListEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
assert(m_optionsOnly); // Handling Additions on the fly not implemented
|
||||
|
||||
strListModel->setItemsEditable(false);
|
||||
QModelIndex currentItem = m_listView->selectionModel()->currentIndex();
|
||||
QModelIndex currentItem = m_listView->selectionModel()->currentIndex();
|
||||
QStringList texts = PdmOptionItemInfo::extractUiTexts(m_options);
|
||||
strListModel->setStringList(texts);
|
||||
|
||||
@ -204,7 +204,7 @@ void PdmUiListEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
m_listView->selectionModel()->blockSignals(true);
|
||||
|
||||
QItemSelection selection = m_listView->selectionModel()->selection();
|
||||
QModelIndex currentItem = m_listView->selectionModel()->currentIndex();
|
||||
QModelIndex currentItem = m_listView->selectionModel()->currentIndex();
|
||||
QVariant fieldValue = field()->uiValue();
|
||||
QStringList texts = fieldValue.toStringList();
|
||||
texts.push_back("");
|
||||
|
@ -163,7 +163,7 @@ QVariant caf::UiListViewModelPdm::data(const QModelIndex &index, int role /*= Qt
|
||||
fieldIndex = index.column();
|
||||
}
|
||||
|
||||
PdmUiFieldHandle* uiFieldHandle = fields[fieldIndex]->uiCapability();
|
||||
PdmUiFieldHandle* uiFieldHandle = fields[fieldIndex]->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
return uiFieldHandle->uiValue();
|
||||
|
@ -174,11 +174,11 @@ void PdmUiTableViewEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pdmListField && m_pdmListField->uiCapability())
|
||||
if (m_pdmListField && m_pdmListField->uiCapability())
|
||||
{
|
||||
QString text = "";
|
||||
m_tableHeadingIcon->setPixmap(m_pdmListField->uiCapability()->uiIcon(uiConfigName).pixmap(16, 16));
|
||||
m_tableHeading->setText(m_pdmListField->uiCapability()->uiName(uiConfigName) + QString(" (%1)").arg(m_pdmListField->size()));
|
||||
m_tableHeadingIcon->setPixmap(m_pdmListField->uiCapability()->uiIcon(uiConfigName).pixmap(16, 16));
|
||||
m_tableHeading->setText(m_pdmListField->uiCapability()->uiName(uiConfigName) + QString(" (%1)").arg(m_pdmListField->size()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -195,11 +195,11 @@ void PdmUiTableViewEditor::setListField(PdmChildArrayFieldHandle* pdmListField)
|
||||
{
|
||||
m_pdmListField = pdmListField;
|
||||
|
||||
caf::PdmUiFieldHandle* uifield = NULL;
|
||||
if (m_pdmListField)
|
||||
{
|
||||
uifield = m_pdmListField->uiCapability();
|
||||
}
|
||||
caf::PdmUiFieldHandle* uifield = NULL;
|
||||
if (m_pdmListField)
|
||||
{
|
||||
uifield = m_pdmListField->uiCapability();
|
||||
}
|
||||
this->bindToPdmItem(uifield);
|
||||
|
||||
if (!m_pdmListField)
|
||||
@ -405,9 +405,9 @@ void PdmUiTableViewEditor::updateSelectionManagerFromTableSelection()
|
||||
QModelIndex mi = modelIndexList[i];
|
||||
PdmFieldHandle* pdmFieldHandle = m_tableModelPdm->getField(mi);
|
||||
|
||||
if (pdmFieldHandle && pdmFieldHandle->uiCapability())
|
||||
{
|
||||
items.push_back(pdmFieldHandle->uiCapability());
|
||||
if (pdmFieldHandle && pdmFieldHandle->uiCapability())
|
||||
{
|
||||
items.push_back(pdmFieldHandle->uiCapability());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ QVariant PdmUiTableViewModel::headerData(int section, Qt::Orientation orientatio
|
||||
{
|
||||
if (orientation == Qt::Horizontal)
|
||||
{
|
||||
PdmUiFieldHandle* uiFieldHandle = getField(createIndex(0, section))->uiCapability();
|
||||
PdmUiFieldHandle* uiFieldHandle = getField(createIndex(0, section))->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
return uiFieldHandle->uiName(m_currentConfigName);
|
||||
@ -143,7 +143,7 @@ Qt::ItemFlags PdmUiTableViewModel::flags(const QModelIndex &index) const
|
||||
}
|
||||
|
||||
PdmFieldHandle* field = getField(index);
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
if (uiFieldHandle->isUiReadOnly(m_currentConfigName))
|
||||
@ -169,7 +169,7 @@ bool PdmUiTableViewModel::setData(const QModelIndex &index, const QVariant &valu
|
||||
bool toggleOn = (value == Qt::Checked);
|
||||
PdmFieldHandle* field = getField(index);
|
||||
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
PdmUiCommandSystemProxy::instance()->setUiValueToField(uiFieldHandle, toggleOn);
|
||||
|
||||
return true;
|
||||
@ -187,7 +187,7 @@ QVariant PdmUiTableViewModel::data(const QModelIndex &index, int role /*= Qt::Di
|
||||
if (role == Qt::DisplayRole || role == Qt::EditRole)
|
||||
{
|
||||
PdmFieldHandle* fieldHandle = getField(index);
|
||||
PdmUiFieldHandle* uiFieldHandle = fieldHandle->uiCapability();
|
||||
PdmUiFieldHandle* uiFieldHandle = fieldHandle->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
bool fromMenuOnly = false;
|
||||
@ -242,7 +242,7 @@ QVariant PdmUiTableViewModel::data(const QModelIndex &index, int role /*= Qt::Di
|
||||
{
|
||||
if (isRepresentingBoolean(index))
|
||||
{
|
||||
PdmUiFieldHandle* uiFieldHandle = getField(index)->uiCapability();
|
||||
PdmUiFieldHandle* uiFieldHandle = getField(index)->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
QVariant val = uiFieldHandle->uiValue();
|
||||
@ -445,7 +445,7 @@ PdmUiFieldEditorHandle* PdmUiTableViewModel::getEditor(const QModelIndex &index)
|
||||
{
|
||||
if (field)
|
||||
{
|
||||
editor->setField(field->uiCapability());
|
||||
editor->setField(field->uiCapability());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -521,9 +521,9 @@ PdmObjectHandle* PdmUiTableViewModel::pdmObjectForRow(int row) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool PdmUiTableViewModel::isRepresentingBoolean(const QModelIndex &index) const
|
||||
{
|
||||
if (getField(index))
|
||||
if (getField(index))
|
||||
{
|
||||
QVariant val = getField(index)->uiCapability()->uiValue();
|
||||
QVariant val = getField(index)->uiCapability()->uiValue();
|
||||
if (val.type() == QVariant::Bool)
|
||||
{
|
||||
return true;
|
||||
|
@ -144,7 +144,7 @@ void PdmUiToolBarEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
}
|
||||
*/
|
||||
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
|
||||
QString editorTypeName;
|
||||
if (uiFieldHandle && uiFieldHandle->uiValue().type() == QVariant::Bool)
|
||||
@ -181,7 +181,7 @@ void PdmUiToolBarEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
// See Qt doc for QToolBar::insertWidget
|
||||
QAction* action = m_actions[static_cast<int>(i)];
|
||||
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
action->setEnabled(!uiFieldHandle->isUiReadOnly(uiConfigName));
|
||||
@ -201,7 +201,7 @@ void PdmUiToolBarEditor::setFields(std::vector<caf::PdmFieldHandle*>& fields)
|
||||
|
||||
for (size_t i = 0; i < fields.size(); i++)
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = fields[i]->uiCapability();
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = fields[i]->uiCapability();
|
||||
|
||||
// Supports only bool fields
|
||||
assert(uiFieldHandle->uiValue().type() == QVariant::Bool);
|
||||
|
@ -187,13 +187,13 @@ void PdmUiTreeViewModel::updateSubTree(PdmUiItem* pdmRoot)
|
||||
|
||||
updateEditorsForSubTree(existingSubTreeRoot);
|
||||
|
||||
// Notify Qt that the toggle/name/icon etc might have been changed
|
||||
emitDataChanged(existingSubTreeRootModIdx);
|
||||
// Notify Qt that the toggle/name/icon etc might have been changed
|
||||
emitDataChanged(existingSubTreeRootModIdx);
|
||||
|
||||
#if CAF_PDM_TREE_VIEW_DEBUG_PRINT
|
||||
std::cout << std::endl << "Result :"<< std::endl ;
|
||||
existingSubTreeRoot->debugDump(0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
class RecursiveUpdateData
|
||||
@ -557,7 +557,7 @@ QVariant PdmUiTreeViewModel::data(const QModelIndex &index, int role ) const
|
||||
QVariant v;
|
||||
if (pdmUiObject->userDescriptionField())
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = pdmUiObject->userDescriptionField()->uiCapability();
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = pdmUiObject->userDescriptionField()->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
v = uiFieldHandle->uiValue();
|
||||
@ -637,7 +637,7 @@ QVariant PdmUiTreeViewModel::data(const QModelIndex &index, int role ) const
|
||||
PdmUiObjectHandle* pdmUiObj = uiObj(uitreeOrdering->object());
|
||||
if (pdmUiObj && pdmUiObj->objectToggleField())
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = pdmUiObj->objectToggleField()->uiCapability();
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = pdmUiObj->objectToggleField()->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
bool isToggledOn = uiFieldHandle->uiValue().toBool();
|
||||
@ -681,7 +681,7 @@ bool PdmUiTreeViewModel::setData(const QModelIndex &index, const QVariant &value
|
||||
{
|
||||
if (role == Qt::EditRole && uiObject->userDescriptionField())
|
||||
{
|
||||
PdmUiFieldHandle* userDescriptionUiField = uiObject->userDescriptionField()->uiCapability();
|
||||
PdmUiFieldHandle* userDescriptionUiField = uiObject->userDescriptionField()->uiCapability();
|
||||
if (userDescriptionUiField)
|
||||
{
|
||||
userDescriptionUiField->setValueFromUi(value);
|
||||
@ -693,7 +693,7 @@ bool PdmUiTreeViewModel::setData(const QModelIndex &index, const QVariant &value
|
||||
{
|
||||
bool toggleOn = (value == Qt::Checked);
|
||||
|
||||
PdmUiFieldHandle* toggleUiField = uiObject->objectToggleField()->uiCapability();
|
||||
PdmUiFieldHandle* toggleUiField = uiObject->objectToggleField()->uiCapability();
|
||||
if (toggleUiField)
|
||||
{
|
||||
toggleUiField->setValueFromUi(value);
|
||||
@ -727,7 +727,7 @@ Qt::ItemFlags PdmUiTreeViewModel::flags(const QModelIndex &index) const
|
||||
PdmUiObjectHandle* pdmUiObject = uiObj(treeItem->object());
|
||||
if (pdmUiObject)
|
||||
{
|
||||
if (pdmUiObject->userDescriptionField() && !pdmUiObject->userDescriptionField()->uiCapability()->isUiReadOnly())
|
||||
if (pdmUiObject->userDescriptionField() && !pdmUiObject->userDescriptionField()->uiCapability()->isUiReadOnly())
|
||||
{
|
||||
flagMask = flagMask | Qt::ItemIsEditable;
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ QVariant UiTreeModelPdm::data(const QModelIndex &index, int role /*= Qt::Display
|
||||
{
|
||||
if (children[cIdx] == obj)
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = fields[i]->uiCapability();
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = fields[i]->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
parentField = uiFieldHandle;
|
||||
@ -225,7 +225,7 @@ QVariant UiTreeModelPdm::data(const QModelIndex &index, int role /*= Qt::Display
|
||||
{
|
||||
if (uiObject->userDescriptionField())
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = uiObject->userDescriptionField()->uiCapability();
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = uiObject->userDescriptionField()->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
return uiFieldHandle->uiValue();
|
||||
@ -279,7 +279,7 @@ QVariant UiTreeModelPdm::data(const QModelIndex &index, int role /*= Qt::Display
|
||||
{
|
||||
if (uiObject && uiObject->objectToggleField())
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = uiObject->objectToggleField()->uiCapability();
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = uiObject->objectToggleField()->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
bool isToggledOn = uiFieldHandle->uiValue().toBool();
|
||||
@ -332,7 +332,7 @@ bool UiTreeModelPdm::setData(const QModelIndex &index, const QVariant &value, in
|
||||
{
|
||||
if (role == Qt::EditRole && uiObject->userDescriptionField())
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = uiObject->userDescriptionField()->uiCapability();
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = uiObject->userDescriptionField()->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
uiFieldHandle->setValueFromUi(value);
|
||||
@ -346,7 +346,7 @@ bool UiTreeModelPdm::setData(const QModelIndex &index, const QVariant &value, in
|
||||
{
|
||||
bool toggleOn = (value == Qt::Checked);
|
||||
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = uiObject->objectToggleField()->uiCapability();
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = uiObject->objectToggleField()->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
uiFieldHandle->setValueFromUi(toggleOn);
|
||||
@ -378,7 +378,7 @@ Qt::ItemFlags UiTreeModelPdm::flags(const QModelIndex &index) const
|
||||
PdmUiObjectHandle* uiObject = uiObj(treeItem->dataObject());
|
||||
if (uiObject)
|
||||
{
|
||||
if (uiObject->userDescriptionField() && !uiObject->userDescriptionField()->uiCapability()->isUiReadOnly())
|
||||
if (uiObject->userDescriptionField() && !uiObject->userDescriptionField()->uiCapability()->isUiReadOnly())
|
||||
{
|
||||
flagMask = flagMask | Qt::ItemIsEditable;
|
||||
}
|
||||
@ -651,7 +651,7 @@ PdmUiTreeItem* UiTreeItemBuilderPdm::buildViewItems(PdmUiTreeItem* parentTreeIte
|
||||
// Fix for hidden legend definitions. There is only one visible legend definition, the others reside in a hidden container
|
||||
// Todo: This is a Hack. Must be rewritten when a more general ui tree building method is in place.
|
||||
// See comment at top of this method.
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
if (uiFieldHandle && uiFieldHandle->isUiChildrenHidden())
|
||||
{
|
||||
continue;
|
||||
|
@ -254,14 +254,14 @@ void caf::CeetronNavigation::setCursorFromCurrentState()
|
||||
ManipulatorTrackball::NavigationType navType = m_trackball->activeNavigation();
|
||||
switch (navType)
|
||||
{
|
||||
case ManipulatorTrackball::PAN:
|
||||
case ManipulatorTrackball::PAN:
|
||||
//m_viewer->setCursor(RiuCursors::get(RiuCursors::PAN));
|
||||
return;
|
||||
case ManipulatorTrackball::WALK:
|
||||
//m_viewer->setCursor(RiuCursors::get(RiuCursors::WALK));
|
||||
case ManipulatorTrackball::WALK:
|
||||
//m_viewer->setCursor(RiuCursors::get(RiuCursors::WALK));
|
||||
return;
|
||||
case ManipulatorTrackball::ROTATE:
|
||||
//m_viewer->setCursor(RiuCursors::get(RiuCursors::ROTATE));
|
||||
case ManipulatorTrackball::ROTATE:
|
||||
//m_viewer->setCursor(RiuCursors::get(RiuCursors::ROTATE));
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
|
@ -57,14 +57,14 @@ protected:
|
||||
virtual void setPointOfInterest(cvf::Vec3d poi);
|
||||
|
||||
// Ceetron navigation stuff
|
||||
void mouseMoveEvent(QMouseEvent* event);
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void mouseReleaseEvent(QMouseEvent* event);
|
||||
void mouseMoveEvent(QMouseEvent* event);
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void mouseReleaseEvent(QMouseEvent* event);
|
||||
void wheelEvent(QWheelEvent* event);
|
||||
|
||||
cvf::ManipulatorTrackball::NavigationType
|
||||
getNavigationTypeFromMouseButtons(Qt::MouseButtons mouseButtons);
|
||||
void setCursorFromCurrentState();
|
||||
void setCursorFromCurrentState();
|
||||
|
||||
void initializeRotationCenter();
|
||||
|
||||
|
@ -313,14 +313,14 @@ bool caf::Viewer::event(QEvent* e)
|
||||
case QEvent::MouseButtonRelease:
|
||||
case QEvent::MouseButtonDblClick:
|
||||
case QEvent::MouseMove:
|
||||
case QEvent::TabletMove:
|
||||
case QEvent::TabletPress:
|
||||
case QEvent::TabletMove:
|
||||
case QEvent::TabletPress:
|
||||
case QEvent::TabletRelease:
|
||||
case QEvent::TabletEnterProximity:
|
||||
case QEvent::TabletLeaveProximity:
|
||||
case QEvent::Wheel:
|
||||
case QEvent::TouchBegin:
|
||||
case QEvent::TouchUpdate:
|
||||
case QEvent::TouchUpdate:
|
||||
case QEvent::TouchEnd:
|
||||
if (m_navigationPolicy->handleInputEvent(static_cast<QInputEvent*>(e)))
|
||||
return true;
|
||||
|
@ -123,8 +123,8 @@ public:
|
||||
void enableOverlyPainting(bool val);
|
||||
|
||||
// Performance information for debugging etc.
|
||||
void enablePerfInfoHud(bool enable);
|
||||
bool isPerfInfoHudEnabled();
|
||||
void enablePerfInfoHud(bool enable);
|
||||
bool isPerfInfoHudEnabled();
|
||||
|
||||
void enableForcedImmediateMode(bool enable);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user