Jacob Moen avatar Jacob Moen committed 91a0c6a Merge

Merged default

Comments (0)

Files changed (8)

Add a comment to this file

Documentation/Ofs_v14_Diag.xls

Binary file added.

Ogitor/src/OgitorsProperty.cpp

     //---------------------------------------------------------------------
     OgitorsPropertySet::OgitorsPropertySet() : mType(PROPSET_OBJECT), mRefCount(1)
     {
- 
+
     }
     //---------------------------------------------------------------------
     OgitorsPropertySet::~OgitorsPropertySet()
             OGRE_DELETE i->second;
         }
         mPropertyMap.clear();
-        
+
         for (unsigned int c = 0; c < mPropertyConnections.size(); c++)
         {
             OGRE_DELETE mPropertyConnections[c];
         }
     }
     //---------------------------------------------------------------------
-       void OgitorsPropertySet::propertyChangeTracker(const Ogitors::OgitorsPropertyBase* property, Ogre::Any value)
+    void OgitorsPropertySet::propertyChangeTracker(const Ogitors::OgitorsPropertyBase* property, Ogre::Any value)
     {
         OgitorsPropertyBase *prop = const_cast<OgitorsPropertyBase*>(property);
         for(unsigned int i = 0;i < mListeners.size();i++)
 
         OgitorsPropertyDefMap::iterator defi;
         defi = mDefinitions.insert(OgitorsPropertyDefMap::value_type(name, OgitorsPropertyDef(name, name, name, pType))).first;
-        
+
         OgitorsPropertyBase *prop = 0;
 
         switch(pType)
             break;
         default: assert(prop != 0 && "Invalid Custom Property Type");return 0;
         };
-        
+
         OgitorsPropertySet::addProperty(prop);
 
         return &(defi->second);
 
         OgitorsPropertyDefMap::iterator defi;
         defi = mDefinitions.insert(OgitorsPropertyDefMap::value_type(name, OgitorsPropertyDef(name, name, name, value.propType))).first;
-        
+
         OgitorsPropertyBase *prop = 0;
 
         switch(value.propType)
             break;
         default: assert(prop != 0 && "Invalid Custom Property Type");return 0;
         };
-        
+
         OgitorsPropertySet::addProperty(prop);
 
         return &(defi->second);
 
             OgitorsPropertyDef *clonedef = clone.addProperty(prop->getName(), prop->getType());
             clone.getProperty(prop->getName())->setValue(prop->getValue());
-          
+
             if(options)
             {
                 if(def->getAutoOptionType() == AUTO_OPTIONS_NONE)
     void OgitorsCustomPropertySet::initFromSet(OgitorsCustomPropertySet& set)
     {
         OgitorsUndoManager::getSingletonPtr()->AddUndo(OGRE_NEW CustomSetRebuiltUndo(this));
-        
+
         OgitorsPropertyDefMap::iterator it = mDefinitions.begin();
 
         while(it != mDefinitions.end())
         {
             OGRE_DELETE i->second;
         }
-        
+
         for (unsigned int c = 0; c < mPropertyConnections.size(); c++)
         {
             OGRE_DELETE mPropertyConnections[c];
 
             OgitorsPropertyDef *initdef = addProperty(prop->getName(), prop->getType());
             getProperty(prop->getName())->setValue(prop->getValue());
-            
+
             *initdef = *def;
-          
+
             if(options)
             {
                 if(def->getAutoOptionType() == AUTO_OPTIONS_NONE)
     void OgitorsCustomPropertySet::addFromSet(OgitorsCustomPropertySet& set)
     {
         OgitorsUndoManager::getSingletonPtr()->AddUndo(OGRE_NEW CustomSetRebuiltUndo(this));
-        
+
         for(unsigned int i = 0;i < set.mPropertyVector.size();i++)
         {
             OgitorsPropertyBase         *prop    = set.mPropertyVector[i];
             OgitorsPropertyDef *initdef = addProperty(prop->getName(), prop->getType());
             getProperty(prop->getName())->setValue(prop->getValue());
             *initdef = *def;
-          
+
             if(options)
             {
                 if(def->getAutoOptionType() == AUTO_OPTIONS_NONE)
 
         OgitorsPropertyDefMap::iterator defi = mDefinitions.find(propname);
         assert(defi != mDefinitions.end());
-        
+
         if(defi->second.getAutoOptionType() == AUTO_OPTIONS_NONE)
         {
             PropertyOptionsVector *options = const_cast<PropertyOptionsVector*>(defi->second.getOptions());
                 position = i;
                 break;
             }
-        
-        assert(position != -1);
-        
-        defi = mDefinitions.insert(OgitorsPropertyDefMap::value_type(propname, OgitorsPropertyDef(propname, propname, propname, pType))).first;
 
-        oldprop = 0;
+            assert(position != -1);
 
-        switch(pType)
-        {
-        case PROP_INT:
-            oldprop = OGRE_NEW OgitorsProperty<int>(&(defi->second), 0, 0, 0);
-            break;
-        case PROP_REAL:
-            oldprop = OGRE_NEW OgitorsProperty<Ogre::Real>(&(defi->second), 0, 0, 0);
-            break;
-        case PROP_STRING:
-            oldprop = OGRE_NEW OgitorsProperty<Ogre::String>(&(defi->second), "", 0, 0);
-            break;
-        case PROP_VECTOR2:
-            oldprop = OGRE_NEW OgitorsProperty<Ogre::Vector2>(&(defi->second), Ogre::Vector2::ZERO, 0, 0);
-            break;
-        case PROP_VECTOR3:
-            oldprop = OGRE_NEW OgitorsProperty<Ogre::Vector3>(&(defi->second), Ogre::Vector3::ZERO, 0, 0);
-            break;
-        case PROP_VECTOR4:
-            oldprop = OGRE_NEW OgitorsProperty<Ogre::Vector4>(&(defi->second), Ogre::Vector4::ZERO, 0, 0);
-            break;
-        case PROP_COLOUR:
-            oldprop = OGRE_NEW OgitorsProperty<Ogre::ColourValue>(&(defi->second), Ogre::ColourValue(0,0,0), 0, 0);
-            break;
-        case PROP_BOOL:
-            oldprop = OGRE_NEW OgitorsProperty<bool>(&(defi->second), false, 0, 0);
-            break;
-        case PROP_QUATERNION:
-            oldprop = OGRE_NEW OgitorsProperty<Ogre::Quaternion>(&(defi->second), Ogre::Quaternion::IDENTITY, 0, 0);
-            break;
-        default: assert(oldprop != 0 && "Invalid Custom Property Type");
-        };
+            defi = mDefinitions.insert(OgitorsPropertyDefMap::value_type(propname, OgitorsPropertyDef(propname, propname, propname, pType))).first;
 
-        mPropertyMap.insert(OgitorsPropertyMap::value_type(oldprop->getName(), oldprop));
-        mPropertyVector[position] = oldprop;
+            oldprop = 0;
+
+            switch(pType)
+            {
+            case PROP_INT:
+                oldprop = OGRE_NEW OgitorsProperty<int>(&(defi->second), 0, 0, 0);
+                break;
+            case PROP_REAL:
+                oldprop = OGRE_NEW OgitorsProperty<Ogre::Real>(&(defi->second), 0, 0, 0);
+                break;
+            case PROP_STRING:
+                oldprop = OGRE_NEW OgitorsProperty<Ogre::String>(&(defi->second), "", 0, 0);
+                break;
+            case PROP_VECTOR2:
+                oldprop = OGRE_NEW OgitorsProperty<Ogre::Vector2>(&(defi->second), Ogre::Vector2::ZERO, 0, 0);
+                break;
+            case PROP_VECTOR3:
+                oldprop = OGRE_NEW OgitorsProperty<Ogre::Vector3>(&(defi->second), Ogre::Vector3::ZERO, 0, 0);
+                break;
+            case PROP_VECTOR4:
+                oldprop = OGRE_NEW OgitorsProperty<Ogre::Vector4>(&(defi->second), Ogre::Vector4::ZERO, 0, 0);
+                break;
+            case PROP_COLOUR:
+                oldprop = OGRE_NEW OgitorsProperty<Ogre::ColourValue>(&(defi->second), Ogre::ColourValue(0,0,0), 0, 0);
+                break;
+            case PROP_BOOL:
+                oldprop = OGRE_NEW OgitorsProperty<bool>(&(defi->second), false, 0, 0);
+                break;
+            case PROP_QUATERNION:
+                oldprop = OGRE_NEW OgitorsProperty<Ogre::Quaternion>(&(defi->second), Ogre::Quaternion::IDENTITY, 0, 0);
+                break;
+            default: assert(oldprop != 0 && "Invalid Custom Property Type");
+            };
+
+            mPropertyMap.insert(OgitorsPropertyMap::value_type(oldprop->getName(), oldprop));
+            mPropertyVector[position] = oldprop;
     }
     //---------------------------------------------------------------------
 }

Ogitor/src/TerrainGroupEditor.cpp

     menuitems.push_back(OTR("Manage Terrain Pages") + ";:/icons/additional.svg");
     if(hasPages)
         menuitems.push_back(OTR("Scale/Offset Height Values") + ";:/icons/scale.svg");
+    else
+        menuitems.push_back("");
     
     menuitems.push_back("---");
     menuitems.push_back(OTR("Import Terrain From Heightmap")+ ";:/icons/import.svg");

Plugins/OgSkyx/SkyxEditor.cpp

 {
     mHandle->update(timePassed);
     mHandle->notifyCameraRender(mOgitorsRoot->GetViewport()->getCameraEditor()->getCamera());
-    mProperties.setValue("options::time", mBasicController->getTime());
+    mProperties.setValue("options::currenttime", mBasicController->getTime().x);
 
     return false;
 }
     opt.G                   = mG->get();
     mHandle->getAtmosphereManager()->setOptions(opt);
 
-    mBasicController->setTime(mTime->get());
+    mBasicController->setTime(Ogre::Vector3(mCurrentTime->get(), mTime->get().x, mTime->get().y));
     mBasicController->setEastDirection(mEastPosition->get());
     mBasicController->setMoonPhase(mMoonPhase->get());
 
     PROPERTY_PTR(mTimeMultiplier        , "options::timemultiplier"     , Ogre::Real,           0.01f,                                  0, SETTER(Ogre::Real,           CSkyxEditor, _setOptionsTimeMultiplier));
     
     // SkyX Basic Controller parameters
-    PROPERTY_PTR(mTime                  , "options::time"               , Ogre::Vector3,        Ogre::Vector3(8.80f, 7.50f, 20.50f),    0, SETTER(Ogre::Vector3,        CSkyxEditor, _setOptionsTime));
+    PROPERTY_PTR(mCurrentTime           , "options::currenttime"        , Ogre::Real,           8.80f,                                  0, SETTER(Ogre::Real,           CSkyxEditor, _setOptionsCurrentTime));
+    PROPERTY_PTR(mTime                  , "options::time"               , Ogre::Vector2,        Ogre::Vector2(7.50f, 20.50f),           0, SETTER(Ogre::Vector2,        CSkyxEditor, _setOptionsTime));
     PROPERTY_PTR(mEastPosition          , "options::eastposition"       , Ogre::Vector2,        Ogre::Vector2(0, 1),                    0, SETTER(Ogre::Vector2,        CSkyxEditor, _setOptionsEastPosition));
     PROPERTY_PTR(mMoonPhase             , "options::moonphase"          , Ogre::Real,           0,                                      0, SETTER(Ogre::Real,           CSkyxEditor, _setOptionsMoonPhase));
 
     return true;
 }
 //-----------------------------------------------------------------------------------------
-bool CSkyxEditor::_setOptionsTime(OgitorsPropertyBase* property, const Ogre::Vector3& value)
+bool CSkyxEditor::_setOptionsCurrentTime(OgitorsPropertyBase* property, const Ogre::Real& value)
 {
-    mTime->init(value);
-
-    mBasicController->setTime(value);
+    mBasicController->setTime(Ogre::Vector3(value, mTime->get().x, mTime->get().y));
+    return true;
+}
+//-----------------------------------------------------------------------------------------
+bool CSkyxEditor::_setOptionsTime(OgitorsPropertyBase* property, const Ogre::Vector2& value)
+{
+    mBasicController->setTime(Ogre::Vector3(mCurrentTime->get(), value.x, value.y));
     return true;
 }
 //-----------------------------------------------------------------------------------------
 
     TiXmlElement *pTime = pSkyX->InsertEndChild(TiXmlElement("time"))->ToElement();
     pTime->SetAttribute("multiplier", Ogre::StringConverter::toString(mTimeMultiplier->get()).c_str());
-    pTime->SetAttribute("current", Ogre::StringConverter::toString(mTime->get().x).c_str());
-    pTime->SetAttribute("sunRise", Ogre::StringConverter::toString(mTime->get().y).c_str());
-    pTime->SetAttribute("sunSet",  Ogre::StringConverter::toString(mTime->get().z).c_str());
+    pTime->SetAttribute("current", Ogre::StringConverter::toString(mCurrentTime->get()).c_str());
+    pTime->SetAttribute("sunRise", Ogre::StringConverter::toString(mTime->get().x).c_str());
+    pTime->SetAttribute("sunSet",  Ogre::StringConverter::toString(mTime->get().y).c_str());
     
     TiXmlElement *pEastPosition = pSkyX->InsertEndChild(TiXmlElement("eastPosition"))->ToElement();
     pEastPosition->SetAttribute("X", Ogre::StringConverter::toString(mEastPosition->get().x).c_str());
 
     OgitorsPropertyDef* definition = 0;
 
-    definition = AddPropertyDefinition("options::time",                 "Options::Time",                "", PROP_VECTOR3);
-    definition->setFieldNames("Current", "Sun Rise", "Sun Set");
-    definition->setRange(Ogre::Any(Ogre::Vector3(0, 0, 0)), Ogre::Any(Ogre::Vector3(24, 24, 24)), Ogre::Any(Ogre::Vector3(0.25f, 0.25f, 0.25f)));
+    definition = AddPropertyDefinition("options::currenttime",          "Options::Current Time",        "", PROP_REAL);
+    definition->setRange(Ogre::Any(0.0f), Ogre::Any(24.0f), Ogre::Any(0.25f));
+    definition->setTrackChanges(false);
+    definition = AddPropertyDefinition("options::time",                 "Options::Day Time",            "", PROP_VECTOR2);
+    definition->setFieldNames("Sun Rise", "Sun Set");
+    definition->setRange(Ogre::Any(Ogre::Vector2(0, 0)), Ogre::Any(Ogre::Vector2(24, 24)), Ogre::Any(Ogre::Vector2(0.25f, 0.25f)));
     definition = AddPropertyDefinition("options::timemultiplier",       "Options::Time Mult.",          "", PROP_REAL);
     definition->setRange(Ogre::Any(-1000.0f), Ogre::Any(1000.0f), Ogre::Any(0.25f));
     definition = AddPropertyDefinition("options::miemultiplier",        "Options::Mie Mult.",           "", PROP_REAL);

Plugins/OgSkyx/SkyxEditor.h

         OgitorsProperty<Ogre::Real>         *mTimeMultiplier;
 
         // SkyX Basic Controller parameters
-        OgitorsProperty<Ogre::Vector3>      *mTime;
+        OgitorsProperty<Ogre::Real>         *mCurrentTime;
+        OgitorsProperty<Ogre::Vector2>      *mTime;
         OgitorsProperty<Ogre::Vector2>      *mEastPosition;
         OgitorsProperty<Ogre::Real>         *mMoonPhase;
 
         bool _setOptionsTimeMultiplier(OgitorsPropertyBase* property, const Ogre::Real& value);
 
         // SkyX Basic Controller parameters
-        bool _setOptionsTime(OgitorsPropertyBase* property, const Ogre::Vector3& value);
+        bool _setOptionsCurrentTime(OgitorsPropertyBase* property, const Ogre::Real& value);
+        bool _setOptionsTime(OgitorsPropertyBase* property, const Ogre::Vector2& value);
         bool _setOptionsEastPosition(OgitorsPropertyBase* property, const Ogre::Vector2& value);
         bool _setOptionsMoonPhase(OgitorsPropertyBase* property, const Ogre::Real& value);
 

qtOgitor/include/mainwindow.hxx

     QComboBox*   mSnapMultiplierBox;
     QComboBox*   mCameraViewModeBox;
 
+    QAction*  actHideMenuBar;
     QAction*  actSaveLayout;
     QAction*  actLoadLayout;
     QAction*  actNew;
     QAction*  actEditCopyToTemplate;
     QAction*  actEditCopyToTemplateWithChildren;
 
+    QMenu*    menuCompactMenuBar;
     QMenu*    menuFile;
     QMenu*    menuImport;
     QMenu*    menuExport;
     static void parseAndAppendContextMenuList(QMenu* contextMenu, Ogitors::UTFStringVector menuList, QObject* receiver);
 
 public Q_SLOTS:
+    void hideMenuBar();
     void onAddScriptAction();
     void onExecuteScriptAction(int index);
     void runScriptClicked();

qtOgitor/src/mainwindow.cpp

     menuView->addSeparator();
     menuView->addAction(actLoadLayout);
     menuView->addAction(actSaveLayout);
+    menuView->addSeparator();
+    menuView->addAction(actHideMenuBar);
 
     menuLog = new QMenu(tr("Messages"),mMenuBar);
     menuLog->setObjectName(QString::fromUtf8("menuLog"));

qtOgitor/src/mainwindowactions.cpp

 //------------------------------------------------------------------------------
 void MainWindow::addActions()
 {
+    actHideMenuBar = new QAction(tr("Hide MenuBar"), this);
+    actHideMenuBar->setStatusTip(tr("Hide the menu bar and show as icon in the toolbar"));
+    actHideMenuBar->setCheckable( true );
+    actHideMenuBar->setChecked( false );
+
     actSaveLayout = new QAction(tr("Save Layout"), this);
     actSaveLayout->setStatusTip(tr("Save Current Layout to File"));
     actSaveLayout->setIcon(QIcon(":/icons/filesave.svg"));
 
     connect(selmapper, SIGNAL(mapped( int )), this, SLOT(selectActionTriggered( int )));
 
+    connect(actHideMenuBar, SIGNAL(triggered()), this, SLOT(hideMenuBar()));
     connect(actSaveLayout, SIGNAL(triggered()), this, SLOT(saveLayout()));
     connect(actLoadLayout, SIGNAL(triggered()), this, SLOT(loadLayout()));
     connect(actCamSave, SIGNAL(triggered()), this, SLOT(saveCamera()));
     {
         actSuperFullScreen->setChecked(false);
 
-        mMenuBar->setVisible(true);
+        if( !actHideMenuBar->isChecked() )
+            mMenuBar->setVisible(true);
+
         for(unsigned int i = 0;i < mSubWindowStateSave.size();i++)
         {
              mSubWindowStateSave[i]->setVisible(true);
         {
              mSubWindowStateSave[i]->setVisible(true);
         }
+
         mSubWindowStateSave.clear();
-        mMenuBar->setVisible(true);
+
+        if( !actHideMenuBar->isChecked() )
+            mMenuBar->setVisible(true);
     }
 }
 //------------------------------------------------------------------------------
     OgitorsRoot::getSingletonPtr()->SetRunState(RS_STOPPED);
 }
 //------------------------------------------------------------------------------
+QAction *separatorAction;
+
+void MainWindow::hideMenuBar()
+{
+    if( actHideMenuBar->isChecked() )
+    {
+        mMenuBar->hide();
+        
+        QList<QAction*> actions = mMenuBar->actions();
+
+        menuCompactMenuBar = new QMenu(this);
+        menuCompactMenuBar->addActions( actions );
+        menuCompactMenuBar->menuAction()->setText(tr("Menu"));
+        menuCompactMenuBar->menuAction()->setStatusTip(tr("Menu"));
+        menuCompactMenuBar->menuAction()->setIcon(QIcon(":/icons/toolbar.svg"));
+
+        mFileToolBar->insertAction( actNew, menuCompactMenuBar->menuAction() );
+        separatorAction = mFileToolBar->insertSeparator( actNew );
+    }
+    else
+    {
+        delete menuCompactMenuBar;
+        menuCompactMenuBar = 0;
+
+        delete separatorAction;
+        separatorAction = 0;
+
+        mMenuBar->show();
+    }
+}
+//------------------------------------------------------------------------------
 void MainWindow::parseAndAppendContextMenuList(QMenu* contextMenu, Ogitors::UTFStringVector menuList, QObject* receiver)
 {
     UTFStringVector vList;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.