Initial commit

This commit is contained in:
alexpete
2021-03-05 11:26:34 -08:00
commit a10351f38d
27091 changed files with 5521199 additions and 0 deletions
@@ -0,0 +1,58 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// AZ
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/SerializeContext.h>
// Graph Model
#include <GraphModel/Integration/Helpers.h>
// Landscape Canvas
#include "BaseAreaModifierNode.h"
namespace LandscapeCanvas
{
const QString BaseAreaModifierNode::INBOUND_GRADIENT_X_SLOT_LABEL = QObject::tr("Inbound Gradient X");
const QString BaseAreaModifierNode::INBOUND_GRADIENT_Y_SLOT_LABEL = QObject::tr("Inbound Gradient Y");
const QString BaseAreaModifierNode::INBOUND_GRADIENT_Z_SLOT_LABEL = QObject::tr("Inbound Gradient Z");
const QString BaseAreaModifierNode::INBOUND_GRADIENT_X_INPUT_SLOT_DESCRIPTION = QObject::tr("Inbound Gradient X input slot");
const QString BaseAreaModifierNode::INBOUND_GRADIENT_Y_INPUT_SLOT_DESCRIPTION = QObject::tr("Inbound Gradient Y input slot");
const QString BaseAreaModifierNode::INBOUND_GRADIENT_Z_INPUT_SLOT_DESCRIPTION = QObject::tr("Inbound Gradient Z input slot");
const char* BaseAreaModifierNode::INBOUND_GRADIENT_X_SLOT_ID = "InboundGradientX";
const char* BaseAreaModifierNode::INBOUND_GRADIENT_Y_SLOT_ID = "InboundGradientY";
const char* BaseAreaModifierNode::INBOUND_GRADIENT_Z_SLOT_ID = "InboundGradientZ";
void BaseAreaModifierNode::Reflect(AZ::ReflectContext* context)
{
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
if (serializeContext)
{
serializeContext->Class<BaseAreaModifierNode, BaseNode>()
->Version(0)
;
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
{
editContext->Class<BaseAreaModifierNode>("BaseAreaModifierNode", "")->
ClassElement(AZ::Edit::ClassElements::EditorData, "")->
Attribute(GraphModelIntegration::Attributes::TitlePaletteOverride, "VegetationAreaNodeTitlePalette")
;
}
}
}
BaseAreaModifierNode::BaseAreaModifierNode(GraphModel::GraphPtr graph)
: BaseNode(graph)
{
}
} // namespace LandscapeCanvas
@@ -0,0 +1,64 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
// Landscape Canvas
#include <Editor/Core/Core.h>
#include <Editor/Nodes/BaseNode.h>
namespace AZ
{
class ReflectContext;
}
namespace LandscapeCanvas
{
class BaseAreaModifierNode : public BaseNode
{
public:
AZ_CLASS_ALLOCATOR(BaseAreaModifierNode, AZ::SystemAllocator, 0);
AZ_RTTI(BaseAreaModifierNode, "{9FCA4158-1974-4CE3-93B9-10F1D6A25D9F}", BaseNode);
// Connection slot IDs (not translated, only used internally)
static const char* INBOUND_GRADIENT_X_SLOT_ID;
static const char* INBOUND_GRADIENT_Y_SLOT_ID;
static const char* INBOUND_GRADIENT_Z_SLOT_ID;
// Connection slot labels
static const QString INBOUND_GRADIENT_X_SLOT_LABEL;
static const QString INBOUND_GRADIENT_Y_SLOT_LABEL;
static const QString INBOUND_GRADIENT_Z_SLOT_LABEL;
// Connection slot descriptions
static const QString INBOUND_GRADIENT_X_INPUT_SLOT_DESCRIPTION;
static const QString INBOUND_GRADIENT_Y_INPUT_SLOT_DESCRIPTION;
static const QString INBOUND_GRADIENT_Z_INPUT_SLOT_DESCRIPTION;
static void Reflect(AZ::ReflectContext* context);
BaseAreaModifierNode() = default;
explicit BaseAreaModifierNode(GraphModel::GraphPtr graph);
const BaseNodeType GetBaseNodeType() const override
{
return BaseNode::VegetationAreaModifier;
}
const bool ShouldShowEntityName() const override
{
// Don't show the entity name for Area Modifiers since they will
// be wrapped on a Vegetation Area it would be redundant
return false;
}
};
}
@@ -0,0 +1,74 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Qt
#include <QObject>
// AZ
#include <AzCore/Serialization/SerializeContext.h>
// Graph Model
#include <GraphModel/Model/Slot.h>
// Landscape Canvas
#include "PositionModifierNode.h"
#include <Editor/Core/GraphContext.h>
namespace LandscapeCanvas
{
void PositionModifierNode::Reflect(AZ::ReflectContext* context)
{
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
if (serializeContext)
{
serializeContext->Class<PositionModifierNode, BaseAreaModifierNode>()
->Version(0)
;
}
}
const QString PositionModifierNode::TITLE = QObject::tr("Position Modifier");
PositionModifierNode::PositionModifierNode(GraphModel::GraphPtr graph)
: BaseAreaModifierNode(graph)
{
RegisterSlots();
CreateSlotData();
}
void PositionModifierNode::RegisterSlots()
{
GraphModel::DataTypePtr invalidEntityDataType = GraphContext::GetInstance()->GetDataType(LandscapeCanvasDataTypeEnum::InvalidEntity);
GraphModel::DataTypePtr gradientDataType = GraphContext::GetInstance()->GetDataType(LandscapeCanvasDataTypeEnum::Gradient);
RegisterSlot(GraphModel::SlotDefinition::CreateInputData(
BaseAreaModifierNode::INBOUND_GRADIENT_X_SLOT_ID,
BaseAreaModifierNode::INBOUND_GRADIENT_X_SLOT_LABEL.toUtf8().constData(),
{ gradientDataType, invalidEntityDataType },
AZStd::any(AZ::EntityId()),
BaseAreaModifierNode::INBOUND_GRADIENT_X_INPUT_SLOT_DESCRIPTION.toUtf8().constData()));
RegisterSlot(GraphModel::SlotDefinition::CreateInputData(
BaseAreaModifierNode::INBOUND_GRADIENT_Y_SLOT_ID,
BaseAreaModifierNode::INBOUND_GRADIENT_Y_SLOT_LABEL.toUtf8().constData(),
{ gradientDataType, invalidEntityDataType },
AZStd::any(AZ::EntityId()),
BaseAreaModifierNode::INBOUND_GRADIENT_Y_INPUT_SLOT_DESCRIPTION.toUtf8().constData()));
RegisterSlot(GraphModel::SlotDefinition::CreateInputData(
BaseAreaModifierNode::INBOUND_GRADIENT_Z_SLOT_ID,
BaseAreaModifierNode::INBOUND_GRADIENT_Z_SLOT_LABEL.toUtf8().constData(),
{ gradientDataType, invalidEntityDataType },
AZStd::any(AZ::EntityId()),
BaseAreaModifierNode::INBOUND_GRADIENT_Z_INPUT_SLOT_DESCRIPTION.toUtf8().constData()));
}
} // namespace LandscapeCanvas
@@ -0,0 +1,49 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
// Qt
#include <QString>
// Landscape Canvas
#include <Editor/Core/Core.h>
#include <Editor/Nodes/AreaModifiers/BaseAreaModifierNode.h>
namespace AZ
{
class ReflectContext;
}
namespace LandscapeCanvas
{
class PositionModifierNode : public BaseAreaModifierNode
{
public:
AZ_CLASS_ALLOCATOR(PositionModifierNode, AZ::SystemAllocator, 0);
AZ_RTTI(PositionModifierNode, "{3613E5F4-BBFF-4FC5-90B5-902B3FFE7F8D}", BaseAreaModifierNode);
static void Reflect(AZ::ReflectContext* context);
PositionModifierNode() = default;
explicit PositionModifierNode(GraphModel::GraphPtr graph);
static const QString TITLE;
const char* GetTitle() const override
{
return TITLE.toUtf8().constData();
}
protected:
void RegisterSlots() override;
};
}
@@ -0,0 +1,74 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Qt
#include <QObject>
// AZ
#include <AzCore/Serialization/SerializeContext.h>
// Graph Model
#include <GraphModel/Model/Slot.h>
// Landscape Canvas
#include "RotationModifierNode.h"
#include <Editor/Core/GraphContext.h>
namespace LandscapeCanvas
{
void RotationModifierNode::Reflect(AZ::ReflectContext* context)
{
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
if (serializeContext)
{
serializeContext->Class<RotationModifierNode, BaseAreaModifierNode>()
->Version(0)
;
}
}
const QString RotationModifierNode::TITLE = QObject::tr("Rotation Modifier");
RotationModifierNode::RotationModifierNode(GraphModel::GraphPtr graph)
: BaseAreaModifierNode(graph)
{
RegisterSlots();
CreateSlotData();
}
void RotationModifierNode::RegisterSlots()
{
GraphModel::DataTypePtr invalidEntityDataType = GraphContext::GetInstance()->GetDataType(LandscapeCanvasDataTypeEnum::InvalidEntity);
GraphModel::DataTypePtr gradientDataType = GraphContext::GetInstance()->GetDataType(LandscapeCanvasDataTypeEnum::Gradient);
RegisterSlot(GraphModel::SlotDefinition::CreateInputData(
BaseAreaModifierNode::INBOUND_GRADIENT_X_SLOT_ID,
BaseAreaModifierNode::INBOUND_GRADIENT_X_SLOT_LABEL.toUtf8().constData(),
{ gradientDataType, invalidEntityDataType },
AZStd::any(AZ::EntityId()),
BaseAreaModifierNode::INBOUND_GRADIENT_X_INPUT_SLOT_DESCRIPTION.toUtf8().constData()));
RegisterSlot(GraphModel::SlotDefinition::CreateInputData(
BaseAreaModifierNode::INBOUND_GRADIENT_Y_SLOT_ID,
BaseAreaModifierNode::INBOUND_GRADIENT_Y_SLOT_LABEL.toUtf8().constData(),
{ gradientDataType, invalidEntityDataType },
AZStd::any(AZ::EntityId()),
BaseAreaModifierNode::INBOUND_GRADIENT_Y_INPUT_SLOT_DESCRIPTION.toUtf8().constData()));
RegisterSlot(GraphModel::SlotDefinition::CreateInputData(
BaseAreaModifierNode::INBOUND_GRADIENT_Z_SLOT_ID,
BaseAreaModifierNode::INBOUND_GRADIENT_Z_SLOT_LABEL.toUtf8().constData(),
{ gradientDataType, invalidEntityDataType },
AZStd::any(AZ::EntityId()),
BaseAreaModifierNode::INBOUND_GRADIENT_Z_INPUT_SLOT_DESCRIPTION.toUtf8().constData()));
}
} // namespace LandscapeCanvas
@@ -0,0 +1,49 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
// Qt
#include <QString>
// Landscape Canvas
#include <Editor/Core/Core.h>
#include <Editor/Nodes/AreaModifiers/BaseAreaModifierNode.h>
namespace AZ
{
class ReflectContext;
}
namespace LandscapeCanvas
{
class RotationModifierNode : public BaseAreaModifierNode
{
public:
AZ_CLASS_ALLOCATOR(RotationModifierNode, AZ::SystemAllocator, 0);
AZ_RTTI(RotationModifierNode, "{14B577ED-4135-4711-B9F3-016E106EA66B}", BaseAreaModifierNode);
static void Reflect(AZ::ReflectContext* context);
RotationModifierNode() = default;
explicit RotationModifierNode(GraphModel::GraphPtr graph);
static const QString TITLE;
const char* GetTitle() const override
{
return TITLE.toUtf8().constData();
}
protected:
void RegisterSlots() override;
};
}
@@ -0,0 +1,60 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Qt
#include <QObject>
// AZ
#include <AzCore/Serialization/SerializeContext.h>
// Graph Model
#include <GraphModel/Model/Slot.h>
// Landscape Canvas
#include "ScaleModifierNode.h"
#include <Editor/Core/GraphContext.h>
namespace LandscapeCanvas
{
void ScaleModifierNode::Reflect(AZ::ReflectContext* context)
{
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
if (serializeContext)
{
serializeContext->Class<ScaleModifierNode, BaseAreaModifierNode>()
->Version(0)
;
}
}
const QString ScaleModifierNode::TITLE = QObject::tr("Scale Modifier");
ScaleModifierNode::ScaleModifierNode(GraphModel::GraphPtr graph)
: BaseAreaModifierNode(graph)
{
RegisterSlots();
CreateSlotData();
}
void ScaleModifierNode::RegisterSlots()
{
GraphModel::DataTypePtr invalidEntityDataType = GraphContext::GetInstance()->GetDataType(LandscapeCanvasDataTypeEnum::InvalidEntity);
GraphModel::DataTypePtr gradientDataType = GraphContext::GetInstance()->GetDataType(LandscapeCanvasDataTypeEnum::Gradient);
RegisterSlot(GraphModel::SlotDefinition::CreateInputData(
INBOUND_GRADIENT_SLOT_ID,
INBOUND_GRADIENT_SLOT_LABEL.toUtf8().constData(),
{ gradientDataType, invalidEntityDataType },
AZStd::any(AZ::EntityId()),
INBOUND_GRADIENT_INPUT_SLOT_DESCRIPTION.toUtf8().constData()));
}
} // namespace LandscapeCanvas
@@ -0,0 +1,49 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
// Qt
#include <QString>
// Landscape Canvas
#include <Editor/Core/Core.h>
#include <Editor/Nodes/AreaModifiers/BaseAreaModifierNode.h>
namespace AZ
{
class ReflectContext;
}
namespace LandscapeCanvas
{
class ScaleModifierNode : public BaseAreaModifierNode
{
public:
AZ_CLASS_ALLOCATOR(ScaleModifierNode, AZ::SystemAllocator, 0);
AZ_RTTI(ScaleModifierNode, "{470E2762-A7DF-4500-B4BE-B705ED7EDEDC}", BaseAreaModifierNode);
static void Reflect(AZ::ReflectContext* context);
ScaleModifierNode() = default;
explicit ScaleModifierNode(GraphModel::GraphPtr graph);
static const QString TITLE;
const char* GetTitle() const override
{
return TITLE.toUtf8().constData();
}
protected:
void RegisterSlots() override;
};
}
@@ -0,0 +1,60 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Qt
#include <QObject>
// AZ
#include <AzCore/Serialization/SerializeContext.h>
// Graph Model
#include <GraphModel/Model/Slot.h>
// Landscape Canvas
#include "SlopeAlignmentModifierNode.h"
#include <Editor/Core/GraphContext.h>
namespace LandscapeCanvas
{
void SlopeAlignmentModifierNode::Reflect(AZ::ReflectContext* context)
{
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
if (serializeContext)
{
serializeContext->Class<SlopeAlignmentModifierNode, BaseAreaModifierNode>()
->Version(0)
;
}
}
const QString SlopeAlignmentModifierNode::TITLE = QObject::tr("Slope Alignment Modifier");
SlopeAlignmentModifierNode::SlopeAlignmentModifierNode(GraphModel::GraphPtr graph)
: BaseAreaModifierNode(graph)
{
RegisterSlots();
CreateSlotData();
}
void SlopeAlignmentModifierNode::RegisterSlots()
{
GraphModel::DataTypePtr invalidEntityDataType = GraphContext::GetInstance()->GetDataType(LandscapeCanvasDataTypeEnum::InvalidEntity);
GraphModel::DataTypePtr gradientDataType = GraphContext::GetInstance()->GetDataType(LandscapeCanvasDataTypeEnum::Gradient);
RegisterSlot(GraphModel::SlotDefinition::CreateInputData(
INBOUND_GRADIENT_SLOT_ID,
INBOUND_GRADIENT_SLOT_LABEL.toUtf8().constData(),
{ gradientDataType, invalidEntityDataType },
AZStd::any(AZ::EntityId()),
INBOUND_GRADIENT_INPUT_SLOT_DESCRIPTION.toUtf8().constData()));
}
} // namespace LandscapeCanvas
@@ -0,0 +1,49 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
// Qt
#include <QString>
// Landscape Canvas
#include <Editor/Core/Core.h>
#include <Editor/Nodes/AreaModifiers/BaseAreaModifierNode.h>
namespace AZ
{
class ReflectContext;
}
namespace LandscapeCanvas
{
class SlopeAlignmentModifierNode : public BaseAreaModifierNode
{
public:
AZ_CLASS_ALLOCATOR(SlopeAlignmentModifierNode, AZ::SystemAllocator, 0);
AZ_RTTI(SlopeAlignmentModifierNode, "{3F5771DF-C2A0-4B52-9A91-96253A640A7C}", BaseAreaModifierNode);
static void Reflect(AZ::ReflectContext* context);
SlopeAlignmentModifierNode() = default;
explicit SlopeAlignmentModifierNode(GraphModel::GraphPtr graph);
static const QString TITLE;
const char* GetTitle() const override
{
return TITLE.toUtf8().constData();
}
protected:
void RegisterSlots() override;
};
}