6 #include <unordered_map>
55 using std::make_unique;
57 using std::unique_ptr;
58 using std::unordered_map;
104 #define AVOID_NULLPTR_STRING(arg) (arg == nullptr?"":arg)
113 this->
rampTerrainBrushTexture = TextureReader::read(
"./resources/engine/textures",
"terrain_ramp.png",
false,
false);
137 if (prototype ==
nullptr)
return;
141 if (prototype->getFileName().empty() ==
true)
throw ExceptionBase(
"Could not save file. No filename known");
143 Tools::getPathName(prototype->getFileName()),
144 Tools::getFileName(prototype->getFileName())
153 class OnModelSave:
public virtual Action
156 void performAction()
override {
158 modelEditorTabController->view->saveFile(
159 modelEditorTabController->popUps->getFileDialogScreenController()->getPathName(),
160 modelEditorTabController->popUps->getFileDialogScreenController()->getFileName()
163 modelEditorTabController->showInfoPopUp(
"Warning",
string(exception.what()));
165 modelEditorTabController->popUps->getFileDialogScreenController()->close();
181 if (prototype ==
nullptr)
return;
185 prototype->getFileName().empty() ==
false?Tools::getPathName(prototype->getFileName()):
string(),
188 Tools::getFileName(prototype->getFileName()),
190 new OnModelSave(
this)
195 showInfoPopUp(
"Warning",
"This command is not supported yet");
201 if (StringTools::startsWith(payload,
"file:") ==
false) {
204 auto fileName = StringTools::substring(payload,
string(
"file:").size());
206 if (Tools::hasFileExtension(fileName, TextureReader::getTextureExtensions()) ==
false) {
207 showInfoPopUp(
"Warning",
"You can not drop this file here. Allowed file extensions are " + Tools::enumerateFileExtensions(TextureReader::getTextureExtensions()));
213 if (Tools::hasFileExtension(fileName, TextureReader::getTextureExtensions()) ==
false) {
214 showInfoPopUp(
"Warning",
"You can not drop this file here. Allowed file extensions are " + Tools::enumerateFileExtensions(TextureReader::getTextureExtensions()));
220 if (Tools::hasFileExtension(fileName, PrototypeReader::getModelExtensions()) ==
false) {
221 showInfoPopUp(
"Warning",
"You can not drop this file here. Allowed file extensions are " + Tools::enumerateFileExtensions(PrototypeReader::getModelExtensions()));
244 if (node->
getId() ==
"selectbox_outliner") {
248 if (StringTools::startsWith(node->
getId(),
view->
getTabId() +
"_tab_terrain_add") ==
true) {
255 if (StringTools::startsWith(node->
getId(),
view->
getTabId() +
"_tab_terrain_substract") ==
true) {
262 if (StringTools::startsWith(node->
getId(),
view->
getTabId() +
"_tab_terrain_flatten") ==
true) {
269 if (StringTools::startsWith(node->
getId(),
view->
getTabId() +
"_tab_terrain_smooth") ==
true) {
276 if (StringTools::startsWith(node->
getId(),
view->
getTabId() +
"_tab_terrain_ramp") ==
true) {
283 if (StringTools::startsWith(node->
getId(),
view->
getTabId() +
"_tab_terrain_delete") ==
true) {
290 if (StringTools::startsWith(node->
getId(),
view->
getTabId() +
"_tab_water_water") ==
true) {
297 if (StringTools::startsWith(node->
getId(),
view->
getTabId() +
"_tab_water_delete") ==
true) {
304 if (StringTools::startsWith(node->
getId(),
view->
getTabId() +
"_tab_foliage_add") ==
true) {
311 if (StringTools::startsWith(node->
getId(),
view->
getTabId() +
"_tab_foliage_delete") ==
true) {
319 if (node->
getId() == textureBrushApplyNode) {
325 if (node->
getId() == foliageBrushApplyNode) {
332 if (node->
getId() == foliageBrushPrototypeApplyNode) {
350 if (node->
getId() ==
"selectbox_outliner") {
352 if (StringTools::startsWith(outlinerNode,
"terrain.waters.") ==
true) {
356 class OnTerrainWaterDelete:
public virtual Action
359 void performAction()
override {
360 auto outlinerNode = terrainEditorTabController->view->getEditorView()->getScreenController()->getOutlinerSelection();
361 auto waterIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.waters.").size(), outlinerNode.size()));
362 terrainEditorTabController->deleteWater(waterIdx);
364 terrainEditorTabController->view->getEditorView()->reloadTabOutliner(
"terrain.waters");
366 OnTerrainWaterDelete(
TerrainEditorTabController* terrainEditorTabController): terrainEditorTabController(terrainEditorTabController) {
376 if (outlinerNode ==
"terrain.foliage") {
380 class OnTerrainFoliageAddBrush:
public virtual Action
383 void performAction()
override {
384 auto prototype = terrainEditorTabController->view->getPrototype();
385 auto terrain = prototype !=
nullptr?prototype->getTerrain():
nullptr;
386 if (terrain ==
nullptr)
return;
387 auto brush = terrain->addBrush();
389 terrainEditorTabController->view->getEditorView()->reloadTabOutliner(
"terrain.foliage." + to_string(terrain->getBrushCount() - 1));
391 OnTerrainFoliageAddBrush(
TerrainEditorTabController* terrainEditorTabController): terrainEditorTabController(terrainEditorTabController) {
401 if (StringTools::startsWith(outlinerNode,
"terrain.foliagebrushes.") ==
true) {
406 class OnTerrainDeleteFoliageBrush:
public virtual Action
409 void performAction()
override {
410 auto outlinerNode = terrainEditorTabController->view->getEditorView()->getScreenController()->getOutlinerSelection();
411 auto foliageBrushIdx = -1;
412 auto foliageBrushPrototypeIdx = -1;
413 if (terrainEditorTabController->checkOutlinerFoliageBrushPrototype(outlinerNode, foliageBrushIdx, foliageBrushPrototypeIdx) ==
false)
return;
414 auto prototype = terrainEditorTabController->view->getPrototype();
415 auto terrain = prototype !=
nullptr?prototype->getTerrain():
nullptr;
416 if (terrain ==
nullptr)
return;
417 auto brush = terrain->getBrush(foliageBrushIdx);
418 brush->removePrototype(foliageBrushPrototypeIdx);
419 auto newOutlinerNode =
"terrain.brushes." + to_string(foliageBrushIdx);
421 terrainEditorTabController->view->getEditorView()->reloadTabOutliner(newOutlinerNode);
423 OnTerrainDeleteFoliageBrush(
TerrainEditorTabController* terrainEditorTabController): terrainEditorTabController(terrainEditorTabController) {
433 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
true) {
439 class OnTerrainAddFoliageBrushPrototype:
public virtual Action
442 void performAction()
override {
443 auto outlinerNode = terrainEditorTabController->view->getEditorView()->getScreenController()->getOutlinerSelection();
444 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
false)
return;
445 auto foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.foliage.").size(), outlinerNode.size()));
446 auto prototype = terrainEditorTabController->view->getPrototype();
447 auto terrain = prototype !=
nullptr?prototype->getTerrain():
nullptr;
448 if (terrain ==
nullptr)
return;
449 auto brush = terrain->getBrush(foliageBrushIdx);
450 if (brush ==
nullptr)
return;
451 auto brushPrototype = brush->addPrototype();
452 auto newOutlinerNode =
"terrain.foliagebrushes." + to_string(foliageBrushIdx) +
"." + to_string(brush->getPrototypeCount() - 1);
454 terrainEditorTabController->view->getEditorView()->reloadTabOutliner(newOutlinerNode);
456 OnTerrainAddFoliageBrushPrototype(
TerrainEditorTabController* terrainEditorTabController): terrainEditorTabController(terrainEditorTabController) {
465 class OnTerrainDeleteFoliageBrush:
public virtual Action
468 void performAction()
override {
469 auto outlinerNode = terrainEditorTabController->view->getEditorView()->getScreenController()->getOutlinerSelection();
470 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
false)
return;
471 auto foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.foliage.").size(), outlinerNode.size()));
472 auto prototype = terrainEditorTabController->view->getPrototype();
473 auto terrain = prototype !=
nullptr?prototype->getTerrain():
nullptr;
474 if (terrain ==
nullptr)
return;
475 terrain->removeBrush(foliageBrushIdx);
477 terrainEditorTabController->view->getEditorView()->reloadTabOutliner(
"terrain.foliage");
479 OnTerrainDeleteFoliageBrush(
TerrainEditorTabController* terrainEditorTabController): terrainEditorTabController(terrainEditorTabController) {
494 int tooltipLeft, tooltipTop;
510 if (node->
getId() ==
"terrain_create") {
513 if (node->
getId() ==
"foliagebrush_texture_open") {
515 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
false)
return;
516 auto foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.foliage.").size(), outlinerNode.size()));
518 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
519 if (terrain ==
nullptr)
return;
520 auto brush = terrain->
getBrush(foliageBrushIdx);
521 if (brush ==
nullptr)
return;
524 class OnFoliageBrushFileOpenAction:
public virtual Action
527 void performAction()
override {
528 terrainEditorTabController->setFoliageBrushTexture(
529 terrainEditorTabController->view->getPopUps()->getFileDialogScreenController()->getPathName() +
531 terrainEditorTabController->view->getPopUps()->getFileDialogScreenController()->getFileName()
533 terrainEditorTabController->view->getPopUps()->getFileDialogScreenController()->close();
540 OnFoliageBrushFileOpenAction(
TerrainEditorTabController* terrainEditorTabController): terrainEditorTabController(terrainEditorTabController) {
547 vector<string> extensions = TextureReader::getTextureExtensions();
549 brush->getFileName().empty() ==
false?Tools::getPathName(brush->getFileName()):
string(),
550 "Load foliage brush texture from: ",
552 Tools::getFileName(brush->getFileName()),
554 new OnFoliageBrushFileOpenAction(
this)
557 if (node->
getId() ==
"foliagebrush_texture_remove") {
559 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
false)
return;
560 auto foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.foliage.").size(), outlinerNode.size()));
562 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
563 if (terrain ==
nullptr)
return;
564 auto brush = terrain->
getBrush(foliageBrushIdx);
565 if (brush ==
nullptr)
return;
567 required_dynamic_cast<GUIImageNode*>(
screenNode->
getNodeById(
"foliagebrush_texture"))->setSource(brush->getFileName());
570 if (node->
getId() ==
"foliagebrush_texture_browseto") {
572 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
false)
return;
573 auto foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.foliage.").size(), outlinerNode.size()));
575 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
576 if (terrain ==
nullptr) {
580 auto brush = terrain->getBrush(foliageBrushIdx);
581 if (brush ==
nullptr || brush->getFileName().empty() ==
true) {
587 if (node->
getId() ==
"foliagebrush_prototype_file_open") {
588 class OnTerrainBrushPrototypeFileOpenAction:
public virtual Action
591 void performAction()
override {
592 terrainEditorTabController->setFoliageBrushPrototype(
593 terrainEditorTabController->view->getPopUps()->getFileDialogScreenController()->getPathName() +
595 terrainEditorTabController->view->getPopUps()->getFileDialogScreenController()->getFileName()
597 terrainEditorTabController->view->getPopUps()->getFileDialogScreenController()->close();
604 OnTerrainBrushPrototypeFileOpenAction(
TerrainEditorTabController* terrainEditorTabController): terrainEditorTabController(terrainEditorTabController) {
612 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
613 if (terrain ==
nullptr)
return;
616 auto foliageBrushIdx = -1;
617 auto foliageBrushPrototypeIdx = -1;
619 auto brush = terrain->getBrush(foliageBrushIdx);
620 if (brush ==
nullptr)
return;
621 auto brushPrototype = brush->getPrototype(foliageBrushPrototypeIdx);
622 if (brushPrototype ==
nullptr)
return;
625 brushPrototype->getFileName().empty() ==
false?Tools::getPathName(brushPrototype->getFileName()):
string(),
626 "Load terrain brush texture from: ",
627 PrototypeReader::getPrototypeExtensions(),
628 Tools::getFileName(brushPrototype->getFileName()),
630 new OnTerrainBrushPrototypeFileOpenAction(
this)
633 if (node->
getId() ==
"foliagebrush_prototype_file_remove") {
635 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
636 if (terrain ==
nullptr)
return;
639 auto foliageBrushIdx = -1;
640 auto foliageBrushPrototypeIdx = -1;
642 auto brush = terrain->getBrush(foliageBrushIdx);
643 if (brush ==
nullptr)
return;
644 auto brushPrototype = brush->getPrototype(foliageBrushPrototypeIdx);
645 if (brushPrototype ==
nullptr)
return;
646 brushPrototype->setFileName(
string());
649 required_dynamic_cast<GUIImageNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_file"))->setSource(brushPrototype->getFileName());
651 Console::println(
"TerrainEditorTabController::onAction(): " +
string(exception.what()));
654 if (node->
getId() ==
"foliagebrush_prototype_file_browseto") {
656 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
657 if (terrain ==
nullptr)
return;
660 auto foliageBrushIdx = -1;
661 auto foliageBrushPrototypeIdx = -1;
663 auto brush = terrain->getBrush(foliageBrushIdx);
664 if (brush ==
nullptr) {
668 auto brushPrototype = brush->getPrototype(foliageBrushPrototypeIdx);
669 if (brushPrototype ==
nullptr || brushPrototype->getFileName().empty() ==
true) {
675 if (node->
getId() ==
"terrainbrush_texture_open") {
676 class OnTerrainBrushFileOpenAction:
public virtual Action
679 void performAction()
override {
680 terrainEditorTabController->setTerrainBrushTexture(
681 terrainEditorTabController->view->getPopUps()->getFileDialogScreenController()->getPathName() +
683 terrainEditorTabController->view->getPopUps()->getFileDialogScreenController()->getFileName()
685 terrainEditorTabController->view->getPopUps()->getFileDialogScreenController()->close();
692 OnTerrainBrushFileOpenAction(
TerrainEditorTabController* terrainEditorTabController): terrainEditorTabController(terrainEditorTabController) {
699 vector<string> extensions = TextureReader::getTextureExtensions();
702 "Load terrain brush texture from: ",
706 new OnTerrainBrushFileOpenAction(
this)
709 if (node->
getId() ==
"terrainbrush_texture_remove") {
716 if (node->
getId() ==
"terrainbrush_texture_browseto") {
723 if (node->
getId() ==
"terrain_mirrormode_apply") {
725 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
726 if (terrain ==
nullptr)
return;
727 auto mirrorMode = required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"terrain_mirrormode"))->getController()->getValue().getString();
728 auto flipped = required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"terrain_mirrormode_flipped"))->getController()->getValue().getString() ==
"1";
730 if (mirrorMode ==
"1") {
733 if (mirrorMode ==
"2") {
734 Terrain::mirrorXAxis(
738 terrain->getHeightVector(),
739 terrain->getWaterPositionMapsHeight(),
740 terrain->getWaterPositionMaps(),
741 terrain->getFoliageMaps()
743 terrain->setWidth(terrain->getWidth() * 2.0f);
745 if (mirrorMode ==
"3") {
746 Terrain::mirrorZAxis(
750 terrain->getHeightVector(),
751 terrain->getWaterPositionMapsHeight(),
752 terrain->getWaterPositionMaps(),
753 terrain->getFoliageMaps()
755 terrain->setDepth(terrain->getDepth() * 2.0f);
757 if (mirrorMode ==
"4") {
758 Terrain::mirrorXAxis(
762 terrain->getHeightVector(),
763 terrain->getWaterPositionMapsHeight(),
764 terrain->getWaterPositionMaps(),
765 terrain->getFoliageMaps()
767 terrain->setWidth(terrain->getWidth() * 2.0f);
768 Terrain::mirrorZAxis(
772 terrain->getHeightVector(),
773 terrain->getWaterPositionMapsHeight(),
774 terrain->getWaterPositionMaps(),
775 terrain->getFoliageMaps()
777 terrain->setDepth(terrain->getDepth() * 2.0f);
786 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
788 xml+=
"<selectbox-parent-option image=\"resources/engine/images/folder.png\" text=\"" + GUIParser::escape(
"Terrain") +
"\" value=\"" + GUIParser::escape(
"terrain") +
"\">\n";
790 xml+=
"<selectbox-option image=\"resources/engine/images/terrain.png\" text=\"" + GUIParser::escape(
"Terrain Brush") +
"\" value=\"" + GUIParser::escape(
"terrain.brush") +
"\" />\n";
791 if (terrain !=
nullptr && terrain->getWaterPositionMapsIndices().empty() ==
false) {
792 xml+=
"<selectbox-parent-option image=\"resources/engine/images/terrain_water.png\" text=\"" + GUIParser::escape(
"Water") +
"\" value=\"" + GUIParser::escape(
"terrain.waters") +
"\">\n";
794 for (
auto waterIdx: terrain->getWaterPositionMapsIndices()) {
795 xml+=
"<selectbox-option image=\"resources/engine/images/terrain_water.png\" text=\"" + GUIParser::escape(
"Water " + to_string(i)) +
"\" value=\"" + GUIParser::escape(
"terrain.waters." + to_string(waterIdx)) +
"\" />\n";
798 xml+=
"</selectbox-parent-option>\n";
800 xml+=
"<selectbox-option image=\"resources/engine/images/terrain_water.png\" text=\"" + GUIParser::escape(
"Water") +
"\" value=\"" + GUIParser::escape(
"terrain.waters") +
"\" />\n";
802 if (terrain !=
nullptr && terrain->getBrushCount() > 0) {
803 xml+=
"<selectbox-parent-option image=\"resources/engine/images/folder.png\" text=\"" + GUIParser::escape(
"Foliage") +
"\" value=\"" + GUIParser::escape(
"terrain.foliage") +
"\">\n";
805 for (
auto brush: terrain->getBrushes()) {
806 if (brush->getPrototypeCount() > 0) {
807 xml+=
"<selectbox-parent-option image=\"resources/engine/images/foliage.png\" text=\"" + GUIParser::escape(
"Foliage Brush " + to_string(i)) +
"\" value=\"" + GUIParser::escape(
"terrain.foliage." + to_string(i)) +
"\" >\n";
809 for (
auto brushPrototype: brush->getPrototypes()) {
810 xml+=
"<selectbox-option image=\"resources/engine/images/mesh.png\" text=\"" + GUIParser::escape(
"Prototype " + to_string(j)) +
"\" value=\"" + GUIParser::escape(
"terrain.foliagebrushes." + to_string(i) +
"." + to_string(j)) +
"\" />\n";
813 xml+=
"</selectbox-parent-option>\n";
815 xml+=
"<selectbox-option image=\"resources/engine/images/foliage.png\" text=\"" + GUIParser::escape(
"Foliage Brush " + to_string(i)) +
"\" value=\"" + GUIParser::escape(
"terrain.foliage." + to_string(i)) +
"\" />\n";
819 xml+=
"</selectbox-parent-option>\n";
821 xml+=
"<selectbox-option image=\"resources/engine/images/folder.png\" text=\"" + GUIParser::escape(
"Foliage") +
"\" value=\"" + GUIParser::escape(
"terrain.foliage") +
"\" />\n";
823 auto foliagePrototypeIndices = terrain !=
nullptr?terrain->getFoliagePrototypeIndices():vector<int>();
824 if (foliagePrototypeIndices.empty() ==
false) {
825 xml+=
"<selectbox-parent-option image=\"resources/engine/images/folder.png\" text=\"" + GUIParser::escape(
"Prototypes") +
"\" value=\"" + GUIParser::escape(
"terrain.foliageprototypes") +
"\">\n";
827 for (
auto prototypeIdx: foliagePrototypeIndices) {
828 auto foliagePrototype = terrain->getFoliagePrototype(prototypeIdx);
829 xml+=
"<selectbox-option image=\"resources/engine/images/mesh.png\" text=\"" + GUIParser::escape(Tools::removeFileExtension(Tools::getFileName(foliagePrototype->getFileName()))) +
"\" value=\"" + GUIParser::escape(
"terrain.foliageprototypes." + to_string(prototypeIdx)) +
"\" />\n";
832 xml+=
"</selectbox-parent-option>\n";
834 xml+=
"</selectbox-parent-option>\n";
844 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
845 if (terrain ==
nullptr)
return;
850 auto width = Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"terrain_size_x"))->getController()->getValue().getString());
851 auto depth = Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"terrain_size_z"))->getController()->getValue().getString());
852 if (width < 1.0f || width > 4000.0f)
throw ExceptionBase(
"Width must be within 1 .. 4000");
853 if (depth < 1.0f || depth > 4000.0f)
throw ExceptionBase(
"Depth must be within 1 .. 4000");
854 terrain->getHeightVector().clear();
855 for (
auto idx: terrain->getWaterPositionMapsIndices()) terrain->removeWaterPositionMap(idx);
857 vector<Model*> terrainModels;
858 Terrain::createTerrainModels(width, depth, 0.0f, terrain->getHeightVector(), terrainBoundingBox, terrainModels);
859 Terrain::createFoliageMaps(terrainBoundingBox, terrain->getFoliageMaps());
881 auto foliageBrushIdx = -1;
882 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
true) {
883 foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.foliage.").size(), outlinerNode.size()));
885 auto foliageBrushPrototypeIdx = -1;
889 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
890 if (terrain ==
nullptr)
return;
891 auto brush = terrain->
getBrush(foliageBrushIdx);
892 if (brush ==
nullptr)
return;
908 auto foliageBrushIdx = -1;
909 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
true) {
910 foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.foliage.").size(), outlinerNode.size()));
912 auto foliageBrushPrototypeIdx = -1;
916 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
917 if (terrain ==
nullptr)
return;
918 auto brush = terrain->
getBrush(foliageBrushIdx);
919 if (brush ==
nullptr)
return;
928 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
929 if (terrain ==
nullptr)
return;
933 "<template id=\"details_terrain\" src=\"resources/engine/gui/template_details_terrain.xml\" />\n"
938 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"details_terrain"))->getActiveConditions().add(
"open");
942 Console::println(
"TerrainEditorTabController::setTerrainDetails(): An error occurred: " +
string(exception.what()));
949 "<template id=\"details_terrainbrush\" src=\"resources/engine/gui/template_details_terrainbrush.xml\" />\n"
954 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"details_terrainbrush"))->getActiveConditions().add(
"open");
958 Console::println(
"TerrainEditorTabController::setTerrainBrushDetails(): An error occurred: " +
string(exception.what()));
971 Console::println(
"TerrainEditorTabController::updateTerrainBrushDetails(): An error occurred: " +
string(exception.what()));
981 Console::println(
"TerrainEditorTabController::setTerrainBrushDetails(): An error occurred: " +
string(exception.what()));
990 "<template id=\"details_foliagebrush\" src=\"resources/engine/gui/template_details_foliagebrush.xml\" />\n"
995 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"details_foliagebrush"))->getActiveConditions().add(
"open");
997 Console::println(
"TerrainEditorTabController::setFoliageBrushDetails(): An error occurred: " +
string(exception.what()));
1008 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
false)
return;
1009 auto foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.foliage.").size(), outlinerNode.size()));
1011 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
1012 if (terrain ==
nullptr)
return;
1013 auto brush = terrain->
getBrush(foliageBrushIdx);
1014 if (brush ==
nullptr)
return;
1018 required_dynamic_cast<GUIImageNode*>(
screenNode->
getNodeById(
"foliagebrush_texture"))->setSource(brush->getFileName());
1019 required_dynamic_cast<GUIImageNode*>(
screenNode->
getNodeById(
"foliagebrush_texture"))->setTooltip(brush->getFileName());
1023 Console::println(
"TerrainEditorTabController::updateFoliageBrushDetails(): An error occurred: " +
string(exception.what()));
1031 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
false)
return;
1032 auto foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.foliage.").size(), outlinerNode.size()));
1034 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
1035 if (terrain ==
nullptr)
return;
1036 auto brush = terrain->
getBrush(foliageBrushIdx);
1037 if (brush ==
nullptr)
return;
1041 brush->
setSize(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_size"))->getController()->getValue().getString()));
1042 brush->setDensity(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_density"))->getController()->getValue().getString()));
1044 Console::println(
"TerrainEditorTabController::applyFoliageBrushDetails(): An error occurred: " +
string(exception.what()));
1051 "<template id=\"details_foliagebrush_prototype\" src=\"resources/engine/gui/template_details_foliagebrush_prototype.xml\" />\n"
1055 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
1056 if (terrain ==
nullptr)
return;
1059 auto foliageBrushIdx = -1;
1060 auto foliageBrushPrototypeIdx = -1;
1062 auto brush = terrain->getBrush(foliageBrushIdx);
1063 if (brush ==
nullptr)
return;
1064 auto brushPrototype = brush->getPrototype(foliageBrushPrototypeIdx);
1065 if (brushPrototype ==
nullptr)
return;
1069 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"details_foliagebrush_prototype"))->getActiveConditions().add(
"open");
1071 required_dynamic_cast<GUIImageNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_file"))->setSource(brushPrototype->getFileName());
1072 required_dynamic_cast<GUIImageNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_file"))->setTooltip(brushPrototype->getFileName());
1073 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_object_count"))->getController()->setValue(
MutableString(brushPrototype->getCount()));
1074 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_normalalign"))->getController()->setValue(
MutableString(brushPrototype->isNormalAlign() ==
true?
"1":
""));
1075 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_rotationrange_x_min"))->getController()->setValue(
MutableString(brushPrototype->getRotationXMin()));
1076 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_rotationrange_x_max"))->getController()->setValue(
MutableString(brushPrototype->getRotationXMax()));
1077 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_rotationrange_y_min"))->getController()->setValue(
MutableString(brushPrototype->getRotationYMin()));
1078 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_rotationrange_y_max"))->getController()->setValue(
MutableString(brushPrototype->getRotationYMax()));
1079 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_rotationrange_z_min"))->getController()->setValue(
MutableString(brushPrototype->getRotationZMin()));
1080 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_rotationrange_z_max"))->getController()->setValue(
MutableString(brushPrototype->getRotationZMax()));
1081 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_scalerange_min"))->getController()->setValue(
MutableString(brushPrototype->getScaleMin()));
1082 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_scalerange_max"))->getController()->setValue(
MutableString(brushPrototype->getScaleMax()));
1083 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_heightrange_min"))->getController()->setValue(
MutableString(brushPrototype->getHeightMin()));
1084 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_heightrange_max"))->getController()->setValue(
MutableString(brushPrototype->getHeightMax()));
1085 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_sloperange_min"))->getController()->setValue(
MutableString(brushPrototype->getSlopeMin()));
1086 required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_sloperange_max"))->getController()->setValue(
MutableString(brushPrototype->getSlopeMax()));
1088 Console::println(
"TerrainEditorTabController::setFoliageBrushPrototypeDetails(): An error occurred: " +
string(exception.what()));
1095 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
1096 if (terrain ==
nullptr)
return;
1099 auto foliageBrushIdx = -1;
1100 auto foliageBrushPrototypeIdx = -1;
1102 auto brush = terrain->getBrush(foliageBrushIdx);
1103 if (brush ==
nullptr)
return;
1104 auto brushPrototype = brush->getPrototype(foliageBrushPrototypeIdx);
1105 if (brushPrototype ==
nullptr)
return;
1108 brushPrototype->setCount(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_object_count"))->getController()->getValue().getString()));
1109 brushPrototype->setNormalAlign(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_normalalign"))->getController()->getValue().getString() ==
"1");
1110 brushPrototype->setRotationXMin(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_rotationrange_x_min"))->getController()->getValue().getString()));
1111 brushPrototype->setRotationXMax(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_rotationrange_x_max"))->getController()->getValue().getString()));
1112 brushPrototype->setRotationYMin(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_rotationrange_y_min"))->getController()->getValue().getString()));
1113 brushPrototype->setRotationYMax(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_rotationrange_y_max"))->getController()->getValue().getString()));
1114 brushPrototype->setRotationZMin(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_rotationrange_z_min"))->getController()->getValue().getString()));
1115 brushPrototype->setRotationZMax(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_rotationrange_z_max"))->getController()->getValue().getString()));
1116 brushPrototype->setScaleMin(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_scalerange_min"))->getController()->getValue().getString()));
1117 brushPrototype->setScaleMax(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_scalerange_max"))->getController()->getValue().getString()));
1118 brushPrototype->setHeightMin(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_heightrange_min"))->getController()->getValue().getString()));
1119 brushPrototype->setHeightMax(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_heightrange_max"))->getController()->getValue().getString()));
1120 brushPrototype->setSlopeMin(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_sloperange_min"))->getController()->getValue().getString()));
1121 brushPrototype->setSlopeMax(Float::parse(required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_sloperange_max"))->getController()->getValue().getString()));
1123 Console::println(
"TerrainEditorTabController::applyFoliageBrushPrototypeDetails(): An error occurred: " +
string(exception.what()));
1129 if (StringTools::startsWith(outlinerNode,
"terrain.foliagebrushes.") ==
false)
return false;
1130 auto brushIdxBeginIdx = string(
"terrain.foliagebrushes.").size();
1131 auto brushIdxEndIdx = outlinerNode.find(
'.', brushIdxBeginIdx + 1);
1132 auto prototypeBeginIdx = brushIdxEndIdx + 1;
1133 auto prototypeEndIdx = outlinerNode.size();
1134 foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode, brushIdxBeginIdx, brushIdxEndIdx));
1135 foliageBrushPrototypeIdx = Integer::parse(StringTools::substring(outlinerNode, prototypeBeginIdx, prototypeEndIdx));
1141 if (outlinerNode ==
"terrain") {
1148 if (outlinerNode ==
"terrain.brush") {
1155 if (outlinerNode ==
"terrain.waters" || StringTools::startsWith(outlinerNode,
"terrain.waters.") ==
true) {
1161 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
true) {
1168 if (StringTools::startsWith(outlinerNode,
"terrain.foliagebrushes.") ==
true) {
1185 if (prototype ==
nullptr)
return;
1190 auto depth = prototype->getTerrain()->getDepth();
1192 vector<Model*> terrainModels;
1193 Terrain::createTerrainModels(width, depth, 0.0f, prototype->getTerrain()->getHeightVector(), terrainBoundingBox, terrainModels);
1196 auto waterPositionMapsIndices = prototype->getTerrain()->getWaterPositionMapsIndices();
1197 for (
auto waterPositionMapIdx: waterPositionMapsIndices) {
1198 vector<Model*> waterModels;
1199 Terrain::createWaterModels(
1201 prototype->getTerrain()->getWaterPositionMap(waterPositionMapIdx),
1202 prototype->getTerrain()->getWaterPositionMapHeight(waterPositionMapIdx),
1203 waterPositionMapIdx,
1207 waterPositionMapIdx,
1209 Terrain::computeWaterReflectionEnvironmentMappingPosition(
1210 prototype->getTerrain()->getWaterPositionMap(waterPositionMapIdx),
1211 prototype->getTerrain()->getWaterPositionMapHeight(waterPositionMapIdx)
1226 if (prototype ==
nullptr)
return;
1227 if (terrainModels.empty() ==
true)
return;
1230 Terrain::applyBrushToTerrainModels(
1233 prototype->getTerrain()->getHeightVector(),
1234 brushCenterPosition,
1250 Terrain::updateFoliageTerrainBrush(
1252 prototype->getTerrain()->getHeightVector(),
1253 brushCenterPosition,
1255 prototype->getTerrain()->getFoliageMaps(),
1266 if (prototype ==
nullptr)
return false;
1273 if (terrainModels.empty() ==
true)
return false;
1274 auto terrainModel = terrainModels[0];
1275 if (terrainModel ==
nullptr)
return false;
1279 prototype->getTerrain()->getHeightVector(),
1280 brushCenterPosition,
1288 if (prototype ==
nullptr)
return false;
1292 if (terrainModels.empty() ==
true)
return false;
1293 auto terrainModel = terrainModels[0];
1294 if (terrainModel ==
nullptr)
return false;
1295 return Terrain::getTerrainModelsHeight(
1298 prototype->getTerrain()->getHeightVector(),
1310 if (prototype ==
nullptr)
return;
1311 if (terrainModels.empty() ==
true)
return;
1314 Terrain::applyRampBrushToTerrainModels(
1317 prototype->getTerrain()->getHeightVector(),
1327 Terrain::updateFoliageTerrainRampBrush(
1329 prototype->getTerrain()->getHeightVector(),
1334 prototype->getTerrain()->getFoliageMaps(),
1345 if (prototype ==
nullptr)
return;
1348 if (Terrain::computeWaterPositionMap(
1350 prototype->getTerrain()->getHeightVector(),
1351 brushCenterPosition,
1352 prototype->getTerrain()->getWaterPositionMapHeight(waterPositionMapIdx),
1353 prototype->getTerrain()->getWaterPositionMap(waterPositionMapIdx)) ==
true) {
1355 Terrain::createWaterModels(
1357 prototype->getTerrain()->getWaterPositionMap(waterPositionMapIdx),
1358 prototype->getTerrain()->getWaterPositionMapHeight(waterPositionMapIdx),
1359 waterPositionMapIdx,
1362 waterReflectionEnvironmentMappingPosition = Terrain::computeWaterReflectionEnvironmentMappingPosition(
1363 prototype->getTerrain()->getWaterPositionMap(waterPositionMapIdx),
1364 prototype->getTerrain()->getWaterPositionMapHeight(waterPositionMapIdx)
1367 waterPositionMapIdx,
1369 waterReflectionEnvironmentMappingPosition
1377 if (prototype ==
nullptr)
return;
1385 if (prototype ==
nullptr)
return;
1389 auto foliageBrushIdx = -1;
1390 auto foliageBrushPrototypeIdx = -1;
1392 auto terrain = prototype !=
nullptr?prototype->getTerrain():
nullptr;
1393 if (terrain ==
nullptr)
return;
1394 auto brush = terrain->getBrush(foliageBrushIdx);
1395 if (brush ==
nullptr)
return;
1398 auto foliageBrushTexture = TextureReader::read(Tools::getPathName(brush->getFileName()), Tools::getFileName(brush->getFileName()),
false,
false);
1399 if (foliageBrushTexture ==
nullptr)
return;
1402 view->
setBrush(foliageBrushTexture, brush->getSize(), brush->getDensity());
1407 if (prototype ==
nullptr)
return;
1411 auto foliageBrushIdx = -1;
1412 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
true) {
1413 foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.foliage.").size(), outlinerNode.size()));
1415 auto foliageBrushPrototypeIdx = -1;
1420 auto terrain = prototype !=
nullptr?prototype->getTerrain():
nullptr;
1421 if (terrain ==
nullptr)
return;
1422 auto brush = terrain->getBrush(foliageBrushIdx);
1423 if (brush ==
nullptr)
return;
1429 foliageBrush.brushTexture = TextureReader::read(Tools::getPathName(brush->getFileName()), Tools::getFileName(brush->getFileName()),
false,
false);
1436 for (
auto foliageBrushPrototype: brush->getPrototypes()) {
1438 if (foliageBrushPrototype->getFileName().empty() ==
false) {
1440 foliagePrototype = PrototypeReader::read(
1441 PrototypeReader::getResourcePathName(Tools::getPathName(foliageBrushPrototype->getFileName()), foliageBrushPrototype->getFileName()),
1442 Tools::getFileName(foliageBrushPrototype->getFileName())
1445 Console::println(
"TerrainEditorTabController::updateFoliageBrush(): failed to load prototype: " + foliageBrushPrototype->getFileName());
1448 if (foliagePrototype ==
nullptr)
continue;
1451 .prototypeId = terrain->getFoliagePrototypeIndex(foliagePrototype),
1452 .count = foliageBrushPrototype->getCount(),
1453 .normalAlign = foliageBrushPrototype->isNormalAlign(),
1454 .rotationXMin = foliageBrushPrototype->getRotationXMin(),
1455 .rotationXMax = foliageBrushPrototype->getRotationXMax(),
1456 .rotationYMin = foliageBrushPrototype->getRotationYMin(),
1457 .rotationYMax = foliageBrushPrototype->getRotationYMax(),
1458 .rotationZMin = foliageBrushPrototype->getRotationZMin(),
1459 .rotationZMax = foliageBrushPrototype->getRotationZMax(),
1460 .scaleMin = foliageBrushPrototype->getScaleMin(),
1461 .scaleMax = foliageBrushPrototype->getScaleMax(),
1462 .heightMin = foliageBrushPrototype->getHeightMin(),
1463 .heightMax = foliageBrushPrototype->getHeightMax(),
1464 .slopeMin = foliageBrushPrototype->getSlopeMin(),
1465 .slopeMax = foliageBrushPrototype->getSlopeMax()
1476 if (prototype ==
nullptr)
return;
1480 auto foliageBrushIdx = -1;
1481 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
true) {
1482 foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.foliage.").size(), outlinerNode.size()));
1484 auto foliageBrushPrototypeIdx = -1;
1487 auto terrain = prototype !=
nullptr?prototype->getTerrain():
nullptr;
1488 if (terrain ==
nullptr)
return;
1489 auto brush = terrain->getBrush(foliageBrushIdx);
1490 if (brush ==
nullptr)
return;
1494 auto haveBrushPrototypeIds =
false;
1496 if (foliageBrushPrototype.prototypeId != -1) haveBrushPrototypeIds =
true;
1498 if (haveBrushPrototypeIds ==
false)
return;
1503 case Terrain::BRUSHOPERATION_ADD:
1505 Terrain::applyFoliageDeleteBrush(
1507 brushCenterPosition,
1510 Terrain::BRUSHOPERATION_DELETE,
1511 prototype->getTerrain()->getFoliageMaps(),
1515 Terrain::applyFoliageBrush(
1517 prototype->getTerrain()->getHeightVector(),
1518 brushCenterPosition,
1522 prototype->getTerrain()->getFoliageMaps(),
1526 case Terrain::BRUSHOPERATION_DELETE:
1528 Terrain::applyFoliageDeleteBrush(
1530 brushCenterPosition,
1534 prototype->getTerrain()->getFoliageMaps(),
1551 return Terrain::BRUSHOPERATION_ADD;
1553 if (required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
view->
getTabId() +
"_tab_terrain_substract"))->getController()->getValue().equals(
"1") ==
true) {
1554 return Terrain::BRUSHOPERATION_SUBTRACT;
1556 if (required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
view->
getTabId() +
"_tab_terrain_flatten"))->getController()->getValue().equals(
"1") ==
true) {
1557 return Terrain::BRUSHOPERATION_FLATTEN;
1559 if (required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
view->
getTabId() +
"_tab_terrain_smooth"))->getController()->getValue().equals(
"1") ==
true) {
1560 return Terrain::BRUSHOPERATION_SMOOTH;
1563 return Terrain::BRUSHOPERATION_RAMP;
1565 if (required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
view->
getTabId() +
"_tab_terrain_delete"))->getController()->getValue().equals(
"1") ==
true) {
1566 return Terrain::BRUSHOPERATION_DELETE;
1568 return Terrain::BRUSHOPERATION_NONE;
1574 return Terrain::BRUSHOPERATION_WATER_ADD;
1577 return Terrain::BRUSHOPERATION_WATER_DELETE;
1579 return Terrain::BRUSHOPERATION_NONE;
1585 return Terrain::BRUSHOPERATION_ADD;
1587 if (required_dynamic_cast<GUIElementNode*>(
screenNode->
getNodeById(
view->
getTabId() +
"_tab_foliage_delete"))->getController()->getValue().equals(
"1") ==
true) {
1588 return Terrain::BRUSHOPERATION_DELETE;
1590 return Terrain::BRUSHOPERATION_NONE;
1599 TextureReader::read(
1609 Console::println(
"TerrainEditorTabController::setTerrainBrushTexture(): An error occurred: " +
string(exception.what()));
1621 if (StringTools::startsWith(outlinerNode,
"terrain.foliage.") ==
false)
return;
1622 auto foliageBrushIdx = Integer::parse(StringTools::substring(outlinerNode,
string(
"terrain.foliage.").size(), outlinerNode.size()));
1624 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
1625 if (terrain ==
nullptr)
return;
1626 auto brush = terrain->
getBrush(foliageBrushIdx);
1627 if (brush ==
nullptr)
return;
1630 required_dynamic_cast<GUIImageNode*>(
screenNode->
getNodeById(
"foliagebrush_texture"))->setSource(brush->getFileName());
1632 Console::println(
"TerrainEditorTabController::setFoliageBrushTexture(): An error occurred: " +
string(exception.what()));
1640 auto terrain = prototype !=
nullptr?prototype->
getTerrain():
nullptr;
1641 if (terrain ==
nullptr)
return;
1644 auto foliageBrushIdx = -1;
1645 auto foliageBrushPrototypeIdx = -1;
1647 auto brush = terrain->getBrush(foliageBrushIdx);
1648 if (brush ==
nullptr)
return;
1649 auto brushPrototype = brush->getPrototype(foliageBrushPrototypeIdx);
1650 brushPrototype->setFileName(fileName);
1652 required_dynamic_cast<GUIImageNode*>(
screenNode->
getNodeById(
"foliagebrush_prototype_file"))->setSource(brushPrototype->getFileName());
1654 Console::println(
"TerrainEditorTabController::setFoliageBrushPrototype(): " +
string(exception.what()));
Axis aligned bounding box used for frustum, this is not directly connectable with physics engine.
const Vector3 & getDimensions() const
void setDensity(float density)
Set density.
void setFileName(const string &fileName)
Set texture file name.
void setSize(float size)
Set size.
Prototype terrain definition.
int allocateWaterPositionMapIdx()
void removeWaterPositionMap(int idx)
Remove water position map at given water position map index.
PrototypeTerrainBrush * getBrush(int idx)
Get prototype terrain brush.
PrototypeTerrain * getTerrain()
GUI node controller base class.
const string & getToolTip()
GUI parent node base class thats supporting child nodes.
GUI screen node that represents a screen that can be rendered via GUI system.
GUINode * getNodeById(const string &nodeId)
Get GUI node by id.
Vector2 class representing vector2 mathematical structure and operations with x, y components.
Vector3 class representing vector3 mathematical structure and operations with x, y,...
File system singleton class.
Mutable utf8 aware string class.
virtual void releaseReference()
Releases a reference, thus decrementing the counter and delete it if reference counter is zero.
An attribute is a name-value pair.
Always the top level node.
The element is a container class.
std::exception Exception
Exception base class.