Mapper  0.9.0
API documentation
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
OpenOrienteering::ObjectTagsUndoStep Class Reference

Undo step which modifies object tags. More...

#include <object_undo.h>

Inheritance diagram for OpenOrienteering::ObjectTagsUndoStep:
Inheritance graph
[legend]
Collaboration diagram for OpenOrienteering::ObjectTagsUndoStep:
Collaboration graph
[legend]

Public Member Functions

 ObjectTagsUndoStep (Map *map)
 
 ~ObjectTagsUndoStep () override
 
void addObject (int index) override
 Adds an object (by index) to this step. More...
 
UndoStepundo () override
 Undoes the action and returns a new UndoStep. More...
 
- Public Member Functions inherited from OpenOrienteering::ObjectModifyingUndoStep
 ObjectModifyingUndoStep (Type type, Map *map)
 Creates an ObjectModifyingUndoStep for the given map and its current part. More...
 
 ObjectModifyingUndoStep (Type type, Map *map, int part_index)
 Creates an ObjectModifyingUndoStep for the given map and part. More...
 
 ~ObjectModifyingUndoStep () override
 Destructor. More...
 
int getPartIndex () const
 Returns the index of the map part modified by this undo step. More...
 
void setPartIndex (int part_index)
 Set the index of the map part modified by this undo step. More...
 
virtual bool isEmpty () const
 Returns true if no objects are modified by this undo step. More...
 
bool getModifiedParts (PartSet &out) const override
 Adds the the step's modified part to the container provided by out. More...
 
void getModifiedObjects (int part_index, ObjectSet &out) const override
 Adds the list of the step's modified objects to the container provided by out. More...
 
- Public Member Functions inherited from OpenOrienteering::UndoStep
 UndoStep (Type type, Map *map)
 Constructs an undo step having the given type. More...
 
 UndoStep (const UndoStep &)=delete
 
 UndoStep (UndoStep &&)=delete
 
virtual ~UndoStep ()
 Destructor. More...
 
UndoStepoperator= (const UndoStep &)=delete
 
UndoStepoperator= (UndoStep &&)=delete
 
Type getType () const
 Returns the type of the undo step. More...
 
virtual bool isValid () const
 Returns true if the step can still be undone. More...
 
void save (QXmlStreamWriter &xml) const
 Saves the undo step to the stream in xml format. More...
 

Protected Types

typedef std::map< int, Object::TagsObjectTagsMap
 
- Protected Types inherited from OpenOrienteering::ObjectModifyingUndoStep
typedef std::vector< int > ObjectList
 A list of indices referring to objects in a map part. More...
 

Protected Member Functions

void saveObject (XmlElementWriter &xml, int index) const override
 Saves object details to the the xml stream. More...
 
void loadObject (XmlElementReader &xml, int index) override
 Loads object details from the the xml stream. More...
 
- Protected Member Functions inherited from OpenOrienteering::ObjectModifyingUndoStep
void saveImpl (QXmlStreamWriter &xml) const override
 Saves undo properties to the the xml stream. More...
 
void loadImpl (QXmlStreamReader &xml, SymbolDictionary &symbol_dict) override
 Loads undo properties from the the xml stream. More...
 

Protected Attributes

ObjectTagsMap object_tags_map
 
- Protected Attributes inherited from OpenOrienteering::ObjectModifyingUndoStep
ObjectList modified_objects
 Indices of the existing objects that are modified by this step. More...
 
- Protected Attributes inherited from OpenOrienteering::UndoStep
Type const type
 The type of the undo step. More...
 
Map *const map
 The map this undo step belongs. More...
 

Additional Inherited Members

- Public Types inherited from OpenOrienteering::UndoStep
enum  Type {
  ReplaceObjectsUndoStepType = 0, DeleteObjectsUndoStepType = 1, AddObjectsUndoStepType = 2, SwitchSymbolUndoStepType = 3,
  SwitchDashesUndoStepType = 4, CombinedUndoStepType = 5, ValidNoOpUndoStepType = 6, ObjectTagsUndoStepType = 7,
  MapPartUndoStepType = 8, SwitchPartUndoStepTypeV0 = 9, SwitchPartUndoStepType = 10, InvalidUndoStepType = 999
}
 Types of undo steps for identification. More...
 
typedef std::set< int > PartSet
 A set of integers referring to parts. More...
 
typedef std::set< Object * > ObjectSet
 A set of pointers to objects. More...
 
- Static Public Member Functions inherited from OpenOrienteering::UndoStep
static UndoStepgetUndoStepForType (Type type, Map *map)
 Constructs an undo step of the given type. More...
 
static UndoStepload (QXmlStreamReader &xml, Map *map, SymbolDictionary &symbol_dict)
 Loads the undo step from the stream in xml format. More...
 

Detailed Description

Undo step which modifies object tags.

Member Typedef Documentation

◆ ObjectTagsMap

Constructor & Destructor Documentation

◆ ObjectTagsUndoStep()

OpenOrienteering::ObjectTagsUndoStep::ObjectTagsUndoStep ( Map map)

◆ ~ObjectTagsUndoStep()

OpenOrienteering::ObjectTagsUndoStep::~ObjectTagsUndoStep ( )
override

Member Function Documentation

◆ addObject()

void OpenOrienteering::ObjectTagsUndoStep::addObject ( int  index)
overridevirtual

Adds an object (by index) to this step.

The object must belong to the step's part.

Reimplemented from OpenOrienteering::ObjectModifyingUndoStep.

◆ loadObject()

void OpenOrienteering::ObjectTagsUndoStep::loadObject ( XmlElementReader xml,
int  index 
)
overrideprotectedvirtual

Loads object details from the the xml stream.

The default implemenentation does nothing.

Reimplemented from OpenOrienteering::ObjectModifyingUndoStep.

◆ saveObject()

void OpenOrienteering::ObjectTagsUndoStep::saveObject ( XmlElementWriter xml,
int  index 
) const
overrideprotectedvirtual

Saves object details to the the xml stream.

The default implemenentation does nothing.

Todo:
Write tags in deterministic order

Reimplemented from OpenOrienteering::ObjectModifyingUndoStep.

◆ undo()

UndoStep * OpenOrienteering::ObjectTagsUndoStep::undo ( )
overridevirtual

Undoes the action and returns a new UndoStep.

The returned UndoStep can redo the action again.

Implements OpenOrienteering::UndoStep.

Member Data Documentation

◆ object_tags_map

ObjectTagsMap OpenOrienteering::ObjectTagsUndoStep::object_tags_map
protected

The documentation for this class was generated from the following files: