Files
o3de/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/GridBus.h
T
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

73 lines
2.8 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/Component/EntityId.h>
#include <AzCore/EBus/EBus.h>
#include <AzCore/Math/Vector2.h>
namespace GraphCanvas
{
//! GridRequests
//! Requests which are serviced by the \ref GraphCanvas::Connection component.
class GridRequests : public AZ::EBusTraits
{
public:
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
using BusIdType = AZ::EntityId;
//! Set the major grid line pitch.
//! The pitch is specified in scene coordinates and X and Y can be separately specified.
virtual void SetMajorPitch(const AZ::Vector2&) = 0;
//! Get the major grid line pitch.
//! Contains the distinct X and Y pitches.
virtual AZ::Vector2 GetMajorPitch() const = 0;
//! Set the minor grid line pitch.
//! The pitch is specified in scene coordinates and X and Y can be separately specified.
//! NOTE: This pitch should be a factor of the major pitch.
virtual void SetMinorPitch(const AZ::Vector2&) = 0;
//! Get the minor grid line pitch.
//! Contains the distinct X and Y pitches.
virtual AZ::Vector2 GetMinorPitch() const = 0;
//! When the view is zoomed, the grid lines (minor and/or major) could become too close together to be useful or
//! visually appealing.
//! If the on-screen (i.e. scaled) distance in pixels between grid lines falls below this threshold, they will
//! no longer be drawn. This will cause the minor and then the major grid lines to disappear as we zoom out
//! further and further.
virtual void SetMinimumVisualPitch(int) = 0;
//! Get the smallest on-screen distance between grid lines that is allowable for them to still be rendered.
virtual int GetMinimumVisualPitch() const = 0;
};
using GridRequestBus = AZ::EBus<GridRequests>;
//! ConnectionNotifications
//! Notifications about changes to a connection's state.
class GridNotifications : public AZ::EBusTraits
{
public:
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
using BusIdType = AZ::EntityId;
//! The grid has had its major grid line pitch changed.
virtual void OnMajorPitchChanged(const AZ::Vector2&) {}
//! The grid has had its minor grid line pitch changed.
virtual void OnMinorPitchChanged(const AZ::Vector2&) {}
//! The grid has had its minimum allowable visual grid-line spacing changed.
virtual void OnMinimumVisualPitchChanged(int) {}
};
using GridNotificationBus = AZ::EBus<GridNotifications>;
}