void CollectionPlugin_Group::initAttributes()
{
- data()->addAttribute(CollectionPlugin_Group::LIST_ID(),
+ data()->addAttribute(CollectionPlugin_Group::LIST_ID(),
ModelAPI_AttributeSelectionList::typeId());
}
if (myPanelTypes.find(theType) == myPanelTypes.end())
return aWidget;
- if (theType == "field-panel") {
+ if (theType == "field-panel") {
aWidget = new CollectionPlugin_WidgetField(theParent, theWorkshop, theWidgetApi);
}
class DataTableItemDelegate : public QStyledItemDelegate
{
public:
- DataTableItemDelegate(ModelAPI_AttributeTables::ValueType theType) :
+ DataTableItemDelegate(ModelAPI_AttributeTables::ValueType theType) :
QStyledItemDelegate() { myType = theType; }
- virtual QWidget* createEditor(QWidget* theParent,
- const QStyleOptionViewItem & theOption,
+ virtual QWidget* createEditor(QWidget* theParent,
+ const QStyleOptionViewItem & theOption,
const QModelIndex& theIndex) const;
ModelAPI_AttributeTables::ValueType dataType() const { return myType; }
void setDataType(ModelAPI_AttributeTables::ValueType theType) { myType = theType; }
-
+
signals:
void startEditing();
ModelAPI_AttributeTables::ValueType myType;
};
-QWidget* DataTableItemDelegate::createEditor(QWidget* theParent,
- const QStyleOptionViewItem & theOption,
+QWidget* DataTableItemDelegate::createEditor(QWidget* theParent,
+ const QStyleOptionViewItem & theOption,
const QModelIndex& theIndex ) const
{
if ((theIndex.column() == 0) && (theIndex.row() > 0)) {
QLineEdit* aLineEdt = 0;
switch (myType) {
case ModelAPI_AttributeTables::DOUBLE:
- aLineEdt = dynamic_cast<QLineEdit*>(QStyledItemDelegate::createEditor(theParent,
- theOption,
+ aLineEdt = dynamic_cast<QLineEdit*>(QStyledItemDelegate::createEditor(theParent,
+ theOption,
theIndex));
if (aLineEdt) {
aLineEdt->setValidator(new QDoubleValidator(aLineEdt));
}
break;
case ModelAPI_AttributeTables::INTEGER:
- aLineEdt = dynamic_cast<QLineEdit*>(QStyledItemDelegate::createEditor(theParent,
- theOption,
+ aLineEdt = dynamic_cast<QLineEdit*>(QStyledItemDelegate::createEditor(theParent,
+ theOption,
theIndex));
if (aLineEdt) {
aLineEdt->setValidator(new QIntValidator(aLineEdt));
return aLineEdt;
}
break;
- case ModelAPI_AttributeTables::BOOLEAN:
+ case ModelAPI_AttributeTables::BOOLEAN:
{
QComboBox* aBox = new QComboBox(theParent);
aBox->addItem(MYFalse);
//**********************************************************************************
//**********************************************************************************
CollectionPlugin_WidgetField::
- CollectionPlugin_WidgetField(QWidget* theParent,
- ModuleBase_IWorkshop* theWorkshop,
+ CollectionPlugin_WidgetField(QWidget* theParent,
+ ModuleBase_IWorkshop* theWorkshop,
const Config_WidgetAPI* theData):
ModuleBase_WidgetSelector(theParent, theWorkshop, theData), myHeaderEditor(0),
myIsEditing(false), myActivation(false)
// Type of shapes
myShapeTypeCombo = new QComboBox(aTypesWgt);
QStringList aShapeTypes;
- aShapeTypes << tr("Vertices") << tr("Edges") << tr("Faces")
+ aShapeTypes << tr("Vertices") << tr("Edges") << tr("Faces")
<< tr("Solids") << tr("Objects") << tr("Parts");
myShapeTypeCombo->addItems(aShapeTypes);
aTypesLayout->addRow(tr("Type of shapes"), myShapeTypeCombo);
// Type of field
myFieldTypeCombo = new QComboBox(aTypesWgt);
QStringList aFieldTypes;
- aFieldTypes << tr("Boolean") << tr("Integer") << tr("Double")
+ aFieldTypes << tr("Boolean") << tr("Integer") << tr("Double")
<< tr("String");
myFieldTypeCombo->addItems(aFieldTypes);
myFieldTypeCombo->setCurrentIndex(2);
}
}
} else if ((theObject == myHeaderEditor) && (theEvent->type() == QEvent::FocusOut)) {
- //QHeaderView* aHeader =
+ //QHeaderView* aHeader =
// static_cast<QHeaderView*>(myHeaderEditor->parentWidget()->parentWidget());
QString aNewTitle = myHeaderEditor->text();
//save item text
case ModelAPI_AttributeTables::INTEGER:
aItem->setText("0");
break;
- case ModelAPI_AttributeTables::BOOLEAN:
+ case ModelAPI_AttributeTables::BOOLEAN:
aItem->setText(MYFalse);
break;
}
case ModelAPI_AttributeTables::INTEGER:
aItem->setText(QString::number(theVal.myInt));
break;
- case ModelAPI_AttributeTables::BOOLEAN:
+ case ModelAPI_AttributeTables::BOOLEAN:
aItem->setText(theVal.myBool? MYTrue : MYFalse);
break;
- case ModelAPI_AttributeTables::STRING:
+ case ModelAPI_AttributeTables::STRING:
aItem->setText(theVal.myStr.c_str());
}
return aItem;
QTableWidget* aTable = myDataTblList.first();
int aRows = aTable->rowCount();
// first column contains selected names which should not be stored
- int aColumns = aTable->columnCount() - 1;
+ int aColumns = aTable->columnCount() - 1;
aTablesAttr->setSize(aRows, aColumns, aNbSteps);
aTablesAttr->setType((ModelAPI_AttributeTables::ValueType)aFldType);
aTablesAttr->setSize(aTablesAttr->rows(), aTablesAttr->columns(), myDataTblList.size());
- AttributeSelectionListPtr aSelList =
+ AttributeSelectionListPtr aSelList =
myFeature->data()->selectionList(CollectionPlugin_Field::SELECTED_ID());
if (!aSelList->isInitialized())
return;
if (myShapeTypeCombo->currentIndex() == 5)
return;
- QList<ModuleBase_ViewerPrsPtr> aSelected =
+ QList<ModuleBase_ViewerPrsPtr> aSelected =
myWorkshop->selection()->getSelected(ModuleBase_ISelection::AllControls);
- AttributeSelectionListPtr aSelList =
+ AttributeSelectionListPtr aSelList =
myFeature->data()->selectionList(CollectionPlugin_Field::SELECTED_ID());
aSelList->setSelectionType(getSelectionType(myShapeTypeCombo->currentIndex()));
aSelList->clear();
QTableWidgetItem* aItem = 0;
foreach(QTableWidget* aTable, myDataTblList) {
aTable->setRowCount(aNewRows);
- if (aNewRows > aRows) {
+ if (aNewRows > aRows) {
// Add new data
for(int i = 0; i < aColumns; i++) {
if (i == 0) {
aTable->item(j, i)->setText("0");
}
break;
- case ModelAPI_AttributeTables::BOOLEAN:
+ case ModelAPI_AttributeTables::BOOLEAN:
aTable->item(j, i)->setText(MYFalse);
break;
}
{
activateSelectionAndFilters(theType == 5? false:true);
- AttributeSelectionListPtr aSelList =
+ AttributeSelectionListPtr aSelList =
myFeature->data()->selectionList(CollectionPlugin_Field::SELECTED_ID());
std::string aTypeName = getSelectionType(theType);
{
Q_OBJECT
public:
- CollectionPlugin_WidgetField(QWidget* theParent,
- ModuleBase_IWorkshop* theWorkshop,
+ CollectionPlugin_WidgetField(QWidget* theParent,
+ ModuleBase_IWorkshop* theWorkshop,
const Config_WidgetAPI* theData);
virtual ~CollectionPlugin_WidgetField() {}
}
}
// send
- std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID =
+ std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID =
myListeners.find(theMessage->eventID().eventText());
if (aFindID != myListeners.end()) {
std::map<void*, std::list<Events_Listener*> >::iterator aFindSender = aFindID->second.find(
myImmediateListeners[theID.eventText()] = theListener;
return;
}
- std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID =
+ std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID =
myListeners.find(theID.eventText());
if (aFindID == myListeners.end()) { // create container associated with ID
myListeners[theID.eventText()] = std::map<void*, std::list<Events_Listener*> >();
aFindID = myListeners.find(theID.eventText());
}
- std::map<void*, std::list<Events_Listener*> >::iterator aFindSender =
+ std::map<void*, std::list<Events_Listener*> >::iterator aFindSender =
aFindID->second.find(theSender);
if (aFindSender == aFindID->second.end()) { // create container associated with sender
aFindID->second[theSender] = std::list<Events_Listener*>();
}
}
// send accumulated messages to "groupListeners"
- std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID =
+ std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID =
myListeners.find(theID.eventText());
if (aFindID != myListeners.end()) {
std::map<void*, std::list<Events_Listener*> >::iterator aFindSender =
// conversion of dimension
std::string aSelectionType = aSelectionList->selectionType();
- std::string aDimensionString =
+ std::string aDimensionString =
ExchangePlugin_Tools::selectionType2xaoDimension(aSelectionType);
XAO::Dimension aGroupDimension = XAO::XaoUtils::stringToDimension(aDimensionString);
// conversion of dimension
std::string aSelectionType = aSelectionList->selectionType();
- std::string aDimensionString =
+ std::string aDimensionString =
ExchangePlugin_Tools::selectionType2xaoDimension(aSelectionType);
XAO::Dimension aFieldDimension = XAO::XaoUtils::stringToDimension(aDimensionString);
bool isWholePart = aSelectionType == "part";
std::string aPlacedName = "Placed";
std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theTransformAlgo.mapOfSubShapes();
- FeaturesPlugin_Tools::storeModifiedShapes(theTransformAlgo, theResultBody,
- theBaseShape, aPlacedTag, aPlacedName,
+ FeaturesPlugin_Tools::storeModifiedShapes(theTransformAlgo, theResultBody,
+ theBaseShape, aPlacedTag, aPlacedName,
*aSubShapes.get());
}
std::string aRotatedName = "Rotated";
std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theRotaionAlgo.mapOfSubShapes();
- FeaturesPlugin_Tools::storeModifiedShapes(theRotaionAlgo, theResultBody,
- theBaseShape, aRotatedTag, aRotatedName,
+ FeaturesPlugin_Tools::storeModifiedShapes(theRotaionAlgo, theResultBody,
+ theBaseShape, aRotatedTag, aRotatedName,
*aSubShapes.get());
}
aFeatureOwner->removeResults(0, false);
}
aSel.Select(aNewSub, aNewContext);
-
+
if (aEraseResults) { // flash after Select : in Groups it makes selection with shift working
static Events_Loop* aLoop = Events_Loop::loop();
static const Events_ID kDeletedEvent = aLoop->eventByName(EVENT_OBJECT_DELETED);
if (myArray.IsNull() || !myArray->IsValid()) {
// this could be on undo and then redo creation of the attribute
// in result creation it may be uninitialized
- myIsInitialized =
+ myIsInitialized =
myLab.FindAttribute(TDataStd_ExtStringArray::GetID(), myArray) == Standard_True;
}
// checking the validity because attribute (as a field) may be presented,
(myType == ModelAPI_AttributeTables::BOOLEAN) ?
new TColStd_HArray1OfByte(0, aNewSize - 1) : Handle(TColStd_HArray1OfByte)();
Handle(TColStd_HArray1OfInteger) anOldInt, aNewInt =
- (myType == ModelAPI_AttributeTables::INTEGER) ?
+ (myType == ModelAPI_AttributeTables::INTEGER) ?
new TColStd_HArray1OfInteger(0, aNewSize - 1) : Handle(TColStd_HArray1OfInteger)();
Handle(TColStd_HArray1OfExtendedString) anOldStr, aNewStr =
- (myType == ModelAPI_AttributeTables::STRING) ?
+ (myType == ModelAPI_AttributeTables::STRING) ?
new TColStd_HArray1OfExtendedString(0, aNewSize - 1) :
Handle(TColStd_HArray1OfExtendedString)();
if (aSize != 0) { // copy the previous values into new positions, otherwise default values
myLab.ForgetAttribute(MY_ARRAY_ID(theType));
myType = theType;
int aTables = myTables;
- myTables = 0; // to let setSize know that there is no old array
+ myTables = 0; // to let setSize know that there is no old array
setSize(myRows, myCols, aTables);
} else {
myType = theType;
///
/// The type of values can be changed. But all the values in the tables must have the same one
/// type. The currently allowed types now are: Boolean, Integer, Double, String.
-/// By default there is only one table, but it may be increased/decreased by adding/removing
+/// By default there is only one table, but it may be increased/decreased by adding/removing
/// tables one by one.
/// The number of rows and columns are equal in all tables. If table, row or column is added,
/// the previous values are kept unchanged. New cells are filled by zero, false or empty strings.
for(int a = 0; a < aResults; a++) {
ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(
document()->object(ModelAPI_ResultBody::group(), a));
- if (!aBody.get())
+ if (!aBody.get())
continue;
// check that only results that were created before this field are used
FeaturePtr aResultFeature = document()->feature(aBody);
TNaming_Iterator anItL(aNS);
for(int i = 1; anItL.More(); anItL.Next(), i++) {
// in #1766 IsEqual produced no index of the face
- if(anItL.NewShape().IsSame(theShape)) {
+ if(anItL.NewShape().IsSame(theShape)) {
aName += aPostFix;
aName += TCollection_AsciiString (i).ToCString();
break;
///
/// The type of values can be changed. But all the values in the tables must have the same one
/// type. The currently allowed types now are: Boolean, Integer, Double, String.
-/// By default there is only one table, but it may be increased/decreased by adding/removing
+/// By default there is only one table, but it may be increased/decreased by adding/removing
/// tables one by one.
/// The number of rows and columns are equal in all tables. If table, row or column is added,
/// the previous values are kept unchanged. New cells are filled by zero, false or empty strings.
return myIsProcessed;
}
-const std::list<std::shared_ptr<ModelAPI_ResultParameter> >&
- ModelAPI_ParameterEvalMessage::params() const
+const std::list<std::shared_ptr<ModelAPI_ResultParameter> >&
+ ModelAPI_ParameterEvalMessage::params() const
{
return myParamsList;
}
int anIndex = 0;
for (auto it = theValue.begin(); it != theValue.end(); ++it, ++anIndex)
- theAttribute->setValue(anIndex, *it);
+ theAttribute->setValue(anIndex, *it);
}
//--------------------------------------------------------------------------------------
MODELHIGHAPI_EXPORT
GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection);
-MODELHIGHAPI_EXPORT
+MODELHIGHAPI_EXPORT
ModelAPI_AttributeTables::ValueType valueTypeByStr(const std::string& theValueTypeStr);
-MODELHIGHAPI_EXPORT
+MODELHIGHAPI_EXPORT
std::string strByValueType(const ModelAPI_AttributeTables::ValueType theType);
/// Performs the high level API dump, then closes all and executes the script:
std::string anExpressionString = theExpression;
// ask interpreter to compute the positions in the expression
- std::shared_ptr<ModelAPI_ComputePositionsMessage> aMsg =
+ std::shared_ptr<ModelAPI_ComputePositionsMessage> aMsg =
ModelAPI_ComputePositionsMessage::send(theExpression, theOldName, this);
const std::list<std::pair<int, int> >& aPositions = aMsg->positions();
SessionPtr aMgr = ModelAPI_Session::get();
bool isNewTransaction = !aMgr->isOperation();
// activation may cause changes in current features in document, so it must be in transaction
- if (isNewTransaction)
+ if (isNewTransaction)
aMgr->startOperation("Activation");
aMgr->setActiveDocument(aMgr->moduleDocument());
if (isNewTransaction) aMgr->finishOperation();