Files
UnrealEngineUWP/Engine/Source/Runtime/MeshEditingRuntime/EditableMeshChanges.h
Unrealbot 02dbb9765e Branch snapshot for CL 3327560
[CL 3327560 in Dev-Geometry branch]
2017-03-01 12:26:39 -05:00

736 lines
14 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Change.h"
#include "EditableMeshTypes.h"
// @todo mesheditor: Comment these classes and enums!
struct FDeleteOrphanVerticesChangeInput
{
/** The vertex IDs to get rid of */
TArray<FVertexID> VertexIDsToDelete;
/** Default constructor */
FDeleteOrphanVerticesChangeInput()
: VertexIDsToDelete()
{
}
};
class FDeleteOrphanVerticesChange : public FChange
{
public:
/** Constructor */
FDeleteOrphanVerticesChange( const FDeleteOrphanVerticesChangeInput& InitInput )
: Input( InitInput )
{
}
FDeleteOrphanVerticesChange( FDeleteOrphanVerticesChangeInput&& InitInput )
: Input( MoveTemp( InitInput ) )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FDeleteOrphanVerticesChangeInput Input;
};
struct FDeleteEdgesChangeInput
{
/** The edge IDs to get rid of */
TArray<FEdgeID> EdgeIDsToDelete;
/** Whether we should also delete any vertices that are left orphaned after deleting this edge */
bool bDeleteOrphanedVertices;
/** Default constructor */
FDeleteEdgesChangeInput()
: EdgeIDsToDelete(),
bDeleteOrphanedVertices( true )
{
}
};
class FDeleteEdgesChange : public FChange
{
public:
/** Constructor */
FDeleteEdgesChange( const FDeleteEdgesChangeInput& InitInput )
: Input( InitInput )
{
}
FDeleteEdgesChange( FDeleteEdgesChangeInput&& InitInput )
: Input( MoveTemp( InitInput ) )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FDeleteEdgesChangeInput Input;
};
struct FCreateVerticesChangeInput
{
/** Information about each vertex that will be created */
TArray<FVertexToCreate> VerticesToCreate;
/** Default constructor */
FCreateVerticesChangeInput()
: VerticesToCreate()
{
}
};
class FCreateVerticesChange : public FChange
{
public:
/** Constructor */
FCreateVerticesChange( const FCreateVerticesChangeInput& InitInput )
: Input( InitInput )
{
}
FCreateVerticesChange( FCreateVerticesChangeInput&& InitInput )
: Input( MoveTemp( InitInput ) )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FCreateVerticesChangeInput Input;
};
struct FCreateEdgesChangeInput
{
/** Information about each edge that will be created */
TArray<FEdgeToCreate> EdgesToCreate;
/** Default constructor */
FCreateEdgesChangeInput()
: EdgesToCreate()
{
}
};
class FCreateEdgesChange : public FChange
{
public:
/** Constructor */
FCreateEdgesChange( const FCreateEdgesChangeInput& InitInput )
: Input( InitInput )
{
}
FCreateEdgesChange( FCreateEdgesChangeInput&& InitInput )
: Input( MoveTemp( InitInput ) )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FCreateEdgesChangeInput Input;
};
struct FCreatePolygonsChangeInput
{
/** Information about each polygon that will be created */
TArray<FPolygonToCreate> PolygonsToCreate;
/** Default constructor */
FCreatePolygonsChangeInput()
: PolygonsToCreate()
{
}
};
class FCreatePolygonsChange : public FChange
{
public:
/** Constructor */
FCreatePolygonsChange( const FCreatePolygonsChangeInput& InitInput )
: Input( InitInput )
{
}
FCreatePolygonsChange( FCreatePolygonsChangeInput&& InitInput )
: Input( MoveTemp( InitInput ) )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FCreatePolygonsChangeInput Input;
};
struct FDeletePolygonsChangeInput
{
/** The polygons to get rid of */
TArray<FPolygonRef> PolygonRefsToDelete;
/** Whether we should also delete any edges that are left orphaned after deleting this polygon */
bool bDeleteOrphanedEdges;
/** Whether we should also delete any vertices that are left orphaned after deleting this polygon */
bool bDeleteOrphanedVertices;
/** Whether we should also delete any sections that are left empty after deleting this polygon */
bool bDeleteEmptySections;
/** Default constructor */
FDeletePolygonsChangeInput()
: PolygonRefsToDelete(),
bDeleteOrphanedEdges( true ),
bDeleteOrphanedVertices( true ),
bDeleteEmptySections( false )
{
}
};
class FDeletePolygonsChange : public FChange
{
public:
/** Constructor */
FDeletePolygonsChange( const FDeletePolygonsChangeInput& InitInput )
: Input( InitInput )
{
}
FDeletePolygonsChange( FDeletePolygonsChangeInput&& InitInput )
: Input( MoveTemp ( InitInput ) )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FDeletePolygonsChangeInput Input;
};
struct FSetVerticesAttributesChangeInput
{
TArray<FAttributesForVertex> AttributesForVertices;
};
class FSetVerticesAttributesChange : public FChange
{
public:
/** Constructor */
FSetVerticesAttributesChange( const FSetVerticesAttributesChangeInput& InitInput )
: Input( InitInput )
{
}
FSetVerticesAttributesChange( FSetVerticesAttributesChangeInput&& InitInput )
: Input( MoveTemp( InitInput ) )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FSetVerticesAttributesChangeInput Input;
};
struct FSetEdgesAttributesChangeInput
{
/** Which edges we'll be setting attributes for, along with the attribute data to set */
TArray<FAttributesForEdge> AttributesForEdges;
/** Default constructor */
FSetEdgesAttributesChangeInput()
: AttributesForEdges()
{
}
};
class FSetEdgesAttributesChange : public FChange
{
public:
/** Constructor */
FSetEdgesAttributesChange( const FSetEdgesAttributesChangeInput& InitInput )
: Input( InitInput )
{
}
FSetEdgesAttributesChange( FSetEdgesAttributesChangeInput&& InitInput )
: Input( MoveTemp( InitInput ) )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FSetEdgesAttributesChangeInput Input;
};
struct FSetPolygonsVertexAttributesChangeInput
{
/** Which polygons we'll be setting vertex attributes for, along with the attribute data to set */
TArray<FVertexAttributesForPolygon> VertexAttributesForPolygons;
/** Default constructor */
FSetPolygonsVertexAttributesChangeInput()
: VertexAttributesForPolygons()
{
}
};
class FSetPolygonsVertexAttributesChange : public FChange
{
public:
/** Constructor */
FSetPolygonsVertexAttributesChange( const FSetPolygonsVertexAttributesChangeInput& InitInput )
: Input( InitInput )
{
}
FSetPolygonsVertexAttributesChange( FSetPolygonsVertexAttributesChangeInput&& InitInput )
: Input( MoveTemp( InitInput ) )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FSetPolygonsVertexAttributesChangeInput Input;
};
struct FSetEdgesVerticesChangeInput
{
/** The edge to set new vertices for */
TArray<FVerticesForEdge> VerticesForEdges;
/** Default constructor */
FSetEdgesVerticesChangeInput()
: VerticesForEdges()
{
}
};
class FSetEdgesVerticesChange : public FChange
{
public:
/** Constructor */
FSetEdgesVerticesChange( const FSetEdgesVerticesChangeInput& InitInput )
: Input( InitInput )
{
}
FSetEdgesVerticesChange( FSetEdgesVerticesChangeInput&& InitInput )
: Input( MoveTemp( InitInput ) )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FSetEdgesVerticesChangeInput Input;
};
struct FInsertPolygonPerimeterVerticesChangeInput
{
/** The polygon we'll be inserting vertices into */
FPolygonRef PolygonRef;
/** The first polygon perimeter vertex number to insert indices before */
uint32 InsertBeforeVertexNumber;
/** The vertices to insert, along with their polygon perimeter vertex attributes */
TArray<FVertexAndAttributes> VerticesToInsert;
/** Default constructor */
FInsertPolygonPerimeterVerticesChangeInput()
: PolygonRef( FSectionID::Invalid, FPolygonID::Invalid ),
InsertBeforeVertexNumber( 0 ),
VerticesToInsert()
{
}
};
class FInsertPolygonPerimeterVerticesChange : public FChange
{
public:
/** Constructor */
FInsertPolygonPerimeterVerticesChange( const FInsertPolygonPerimeterVerticesChangeInput& InitInput )
: Input( InitInput )
{
}
FInsertPolygonPerimeterVerticesChange( FInsertPolygonPerimeterVerticesChangeInput&& InitInput )
: Input( MoveTemp( InitInput ) )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FInsertPolygonPerimeterVerticesChangeInput Input;
};
struct FRemovePolygonPerimeterVerticesChangeInput
{
/** The polygon we'll be removing vertices from */
FPolygonRef PolygonRef;
/** The first polygon perimeter vertex number to remove */
uint32 FirstVertexNumberToRemove;
/** The number of vertices to remove */
uint32 NumVerticesToRemove;
/** Default constructor */
FRemovePolygonPerimeterVerticesChangeInput()
: PolygonRef( FSectionID::Invalid, FPolygonID::Invalid ),
FirstVertexNumberToRemove( 0 ),
NumVerticesToRemove( 0 )
{
}
};
class FRemovePolygonPerimeterVerticesChange : public FChange
{
public:
/** Constructor */
FRemovePolygonPerimeterVerticesChange( const FRemovePolygonPerimeterVerticesChangeInput& InitInput )
: Input( InitInput )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FRemovePolygonPerimeterVerticesChangeInput Input;
};
struct FStartOrEndModificationChangeInput
{
/** True if we should start modifying the mesh, or false if we should end modifying the mesh. This will be reversed every time an undo/redo happens */
bool bStartModification;
/** The type of modification we're doing here */
EMeshModificationType MeshModificationType;
/** Whether the mesh's topology can change during this modification */
EMeshTopologyChange MeshTopologyChange;
/** Default constructor */
FStartOrEndModificationChangeInput()
: bStartModification( true ),
MeshModificationType( EMeshModificationType::Final ),
MeshTopologyChange( EMeshTopologyChange::TopologyChange )
{
}
};
class FStartOrEndModificationChange : public FChange
{
public:
/** Constructor */
FStartOrEndModificationChange( const FStartOrEndModificationChangeInput& InitInput )
: Input( InitInput )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FStartOrEndModificationChangeInput Input;
};
struct FRetrianglulatePolygonsChangeInput
{
/** The polygons to retriangulate */
TArray<FPolygonRef> PolygonRefs;
/** Whether we should actually do the retriangulation. This will be inverted every time an Undo/Redo happens */
bool bOnlyOnUndo;
/** Default constructor */
FRetrianglulatePolygonsChangeInput()
: PolygonRefs(),
bOnlyOnUndo( true )
{
}
};
class FRetrianglulatePolygonsChange : public FChange
{
public:
/** Constructor */
FRetrianglulatePolygonsChange( const FRetrianglulatePolygonsChangeInput& InitInput )
: Input( InitInput )
{
}
FRetrianglulatePolygonsChange( FRetrianglulatePolygonsChangeInput&& InitInput )
: Input( MoveTemp( InitInput ) )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FRetrianglulatePolygonsChangeInput Input;
};
struct FSetSubdivisionCountChangeInput
{
/** The new number of subdivisions to use */
int32 NewSubdivisionCount;
/** Default constructor */
FSetSubdivisionCountChangeInput()
: NewSubdivisionCount( 0 )
{
}
};
class FSetSubdivisionCountChange : public FChange
{
public:
/** Constructor */
FSetSubdivisionCountChange( const FSetSubdivisionCountChangeInput& InitInput )
: Input( InitInput )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FSetSubdivisionCountChangeInput Input;
};
struct FCreateSectionChangeInput
{
/** Information about the section to create */
FSectionToCreate SectionToCreate;
/** Default constructor */
FCreateSectionChangeInput()
: SectionToCreate()
{
}
};
class FCreateSectionChange : public FChange
{
public:
/** Constructor */
FCreateSectionChange( const FCreateSectionChangeInput& InitInput )
: Input( InitInput )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FCreateSectionChangeInput Input;
};
struct FDeleteSectionChangeInput
{
/** The section to delete */
FSectionID SectionID;
/** Default constructor */
FDeleteSectionChangeInput()
: SectionID( FSectionID::Invalid )
{
}
};
class FDeleteSectionChange : public FChange
{
public:
/** Constructor */
FDeleteSectionChange( const FDeleteSectionChangeInput& InitInput )
: Input( InitInput )
{
}
// Parent class overrides
virtual TUniquePtr<FChange> Execute( UObject* Object ) override;
virtual FString ToString() const override;
private:
/** The data we need to make this change */
FDeleteSectionChangeInput Input;
};