diff --git a/include/openspace/properties/property.h b/include/openspace/properties/property.h index 80b224bf76..4f40070f44 100644 --- a/include/openspace/properties/property.h +++ b/include/openspace/properties/property.h @@ -314,10 +314,10 @@ public: * Property::ViewOptions::PowerScaledCoordinate = powerScaledCoordinate. */ struct ViewOptions { - static const std::string Color; - static const std::string LightPosition; - static const std::string PowerScaledScalar; - static const std::string PowerScaledCoordinate; + static const char* Color; + static const char* LightPosition; + static const char* PowerScaledScalar; + static const char* PowerScaledCoordinate; }; /** @@ -329,10 +329,10 @@ public: const ghoul::Dictionary& metaData() const; protected: - static const std::string IdentifierKey; - static const std::string NameKey; - static const std::string TypeKey; - static const std::string MetaDataKey; + static const char* IdentifierKey; + static const char* NameKey; + static const char* TypeKey; + static const char* MetaDataKey; /** * Creates the information that is general to every Property and adds the diff --git a/include/openspace/properties/propertyowner.h b/include/openspace/properties/propertyowner.h index 56a69783bb..e26af2db6f 100644 --- a/include/openspace/properties/propertyowner.h +++ b/include/openspace/properties/propertyowner.h @@ -25,7 +25,6 @@ #ifndef __OPENSPACE_CORE___PROPERTYOWNER___H__ #define __OPENSPACE_CORE___PROPERTYOWNER___H__ -#include #include #include #include @@ -33,6 +32,8 @@ namespace openspace { namespace properties { +class Property; + /** * A PropertyOwner can own Propertys or other PropertyOwner and provide access to both in * a unified way. The identifiers and names of Propertys and diff --git a/include/openspace/rendering/abufferrenderer.h b/include/openspace/rendering/abufferrenderer.h index 042c0380dd..798a1373a8 100644 --- a/include/openspace/rendering/abufferrenderer.h +++ b/include/openspace/rendering/abufferrenderer.h @@ -43,14 +43,14 @@ namespace ghoul { - namespace filesystem { - class File; - } - namespace opengl { - class ProgramObject; - class Texture; - } -} +namespace filesystem { class File; } + +namespace opengl { + class ProgramObject; + class Texture; +} // namepsace opengl + +} // namespace ghoul namespace openspace { diff --git a/modules/space/rendering/planetgeometry.h b/modules/space/rendering/planetgeometry.h index eae02b77d1..98b93841c9 100644 --- a/modules/space/rendering/planetgeometry.h +++ b/modules/space/rendering/planetgeometry.h @@ -27,6 +27,10 @@ #include +#include + +namespace ghoul { class Dictionary; } + namespace openspace { class Renderable; diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index bc4da65ab8..6ec3200fe1 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -38,13 +37,8 @@ #include #include #include -#include #include -#include #include -#include -#include -#include #include #include #include @@ -55,28 +49,18 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include #if defined(_MSC_VER) && defined(OPENSPACE_ENABLE_VLD) #include diff --git a/src/properties/property.cpp b/src/properties/property.cpp index 6b495248aa..a70540dea4 100644 --- a/src/properties/property.cpp +++ b/src/properties/property.cpp @@ -32,24 +32,24 @@ namespace openspace { namespace properties { namespace { - const std::string _loggerCat = "Property"; - const std::string MetaDataKeyGuiName = "guiName"; - const std::string MetaDataKeyGroup = "Group"; - const std::string MetaDataKeyVisibility = "Visibility"; - const std::string MetaDataKeyReadOnly = "isReadOnly"; + const char* _loggerCat = "Property"; + const char* MetaDataKeyGuiName = "guiName"; + const char* MetaDataKeyGroup = "Group"; + const char* MetaDataKeyVisibility = "Visibility"; + const char* MetaDataKeyReadOnly = "isReadOnly"; - const std::string _metaDataKeyViewPrefix = "view."; + const char* _metaDataKeyViewPrefix = "view."; } -const std::string Property::ViewOptions::Color = "color"; -const std::string Property::ViewOptions::LightPosition = "lightPosition"; -const std::string Property::ViewOptions::PowerScaledCoordinate = "powerScaledCoordinate"; -const std::string Property::ViewOptions::PowerScaledScalar = "powerScaledScalar"; +const char* Property::ViewOptions::Color = "color"; +const char* Property::ViewOptions::LightPosition = "lightPosition"; +const char* Property::ViewOptions::PowerScaledCoordinate = "powerScaledCoordinate"; +const char* Property::ViewOptions::PowerScaledScalar = "powerScaledScalar"; -const std::string Property::IdentifierKey = "Identifier"; -const std::string Property::NameKey = "Name"; -const std::string Property::TypeKey = "Type"; -const std::string Property::MetaDataKey = "MetaData"; +const char* Property::IdentifierKey = "Identifier"; +const char* Property::NameKey = "Name"; +const char* Property::TypeKey = "Type"; +const char* Property::MetaDataKey = "MetaData"; Property::Property(std::string identifier, std::string guiName, Visibility visibility) : _owner(nullptr) @@ -181,7 +181,7 @@ void Property::notifyListener() { std::string Property::generateBaseDescription() const { return - TypeKey + " = \"" + className() + "\", " + + std::string(TypeKey) + " = \"" + className() + "\", " + IdentifierKey + " = \"" + fullyQualifiedIdentifier() + "\", " + NameKey + " = \"" + guiName() + "\", " + generateMetaDataDescription() + ", " + @@ -201,7 +201,7 @@ std::string Property::generateMetaDataDescription() const { std::string vis = VisibilityConverter.at(visibility); return - MetaDataKey + " = {" + + std::string(MetaDataKey) + " = {" + MetaDataKeyGroup + " = '" + groupIdentifier() + "'," + MetaDataKeyVisibility + " = " + vis + "," + MetaDataKeyReadOnly +" = " + (isReadOnly ? "true" : "false") + "}"; diff --git a/src/properties/propertyowner.cpp b/src/properties/propertyowner.cpp index 43f271a627..e45cd9279f 100644 --- a/src/properties/propertyowner.cpp +++ b/src/properties/propertyowner.cpp @@ -24,6 +24,7 @@ #include +#include #include #include @@ -33,17 +34,16 @@ namespace openspace { namespace properties { namespace { + const char* _loggerCat = "PropertyOwner"; -const char* _loggerCat = "PropertyOwner"; - -bool propertyLess(Property* lhs, Property* rhs) -{ - return lhs->identifier() < rhs->identifier(); -} + bool propertyLess(Property* lhs, Property* rhs) + { + return lhs->identifier() < rhs->identifier(); + } -bool subOwnerLess(PropertyOwner* lhs, PropertyOwner* rhs) { - return lhs->name() < rhs->name(); -} + bool subOwnerLess(PropertyOwner* lhs, PropertyOwner* rhs) { + return lhs->name() < rhs->name(); + } } // namespace diff --git a/support/coding/count_includes.py b/support/coding/count_includes.py new file mode 100644 index 0000000000..98465a57f3 --- /dev/null +++ b/support/coding/count_includes.py @@ -0,0 +1,65 @@ +""" +OpenSpace + +Copyright (c) 2014-2017 + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +This file takes the output of compiling in Visual Studio with /showIncludes enabled and +counts the number of times that each header file is included (excluding system headers). +This gives an indicator as to which header files can be made more efficient the most +efficiently + +The script requires one argument, which is the text file of one or many runs of the +Visual Studio compiler +""" + +import sys + +if len(sys.argv) != 2: + print("Usage: count_includes.py