AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
XCharts.BaseGraph Class Reference

The base class of all graphs or components. 所有图形的基类。 More...

Collaboration diagram for XCharts.BaseGraph:

Public Member Functions

virtual void SetSize (float width, float height)
 设置图形的宽高(在非stretch pivot下才有效,其他情况需要自己调整RectTransform) More...
 
void SetPainterDirty ()
 重新初始化Painter More...
 
void RefreshGraph ()
 Redraw graph in next frame. 在下一帧刷新图形。 More...
 
void RefreshAllComponent ()
 
string CheckWarning ()
 检测警告信息。 More...
 
void RemoveChartObject ()
 移除所有图表子节点,会自动重现初始化。 More...
 
bool ScreenPointToChartPoint (Vector2 screenPoint, out Vector2 chartPoint)
 
virtual void OnPointerClick (PointerEventData eventData)
 
virtual void OnPointerDown (PointerEventData eventData)
 
virtual void OnPointerUp (PointerEventData eventData)
 
virtual void OnPointerEnter (PointerEventData eventData)
 
virtual void OnPointerExit (PointerEventData eventData)
 
virtual void OnBeginDrag (PointerEventData eventData)
 
virtual void OnEndDrag (PointerEventData eventData)
 
virtual void OnDrag (PointerEventData eventData)
 
virtual void OnScroll (PointerEventData eventData)
 

Protected Member Functions

virtual void InitComponent ()
 
override void Awake ()
 
override void Start ()
 
virtual void Update ()
 
virtual void SetAllComponentDirty ()
 
virtual void CheckComponent ()
 
void CheckComponentDirty (ChartComponent component)
 
override void OnDestroy ()
 
override void OnPopulateMesh (VertexHelper vh)
 
virtual void InitPainter ()
 
void UpdateSize ()
 
virtual void CheckIsInScrollRect ()
 
virtual bool IsNeedCheckPointerPos ()
 
virtual void CheckRefreshChart ()
 
virtual void CheckRefreshPainter ()
 
virtual void OnSizeChanged ()
 
virtual void OnLocalPositionChanged ()
 
virtual void OnDrawPainterBase (VertexHelper vh, Painter painter)
 
virtual void DrawPainterBase (VertexHelper vh)
 
virtual void DrawBackground (VertexHelper vh)
 

Protected Attributes

bool m_MultiComponentMode = false
 
bool m_DebugMode = false
 
bool m_EnableTextMeshPro = false
 
Background m_Background = Background.defaultBackground
 
Painter m_Painter
 
int m_SiblingIndex
 
float m_GraphWidth
 
float m_GraphHeight
 
float m_GraphX
 
float m_GraphY
 
Vector3 m_GraphPosition = Vector3.zero
 
Vector2 m_GraphMinAnchor
 
Vector2 m_GraphMaxAnchor
 
Vector2 m_GraphPivot
 
Vector2 m_GraphSizeDelta
 
Vector2 m_GraphAnchoredPosition
 
Rect m_GraphRect = new Rect(0, 0, 0, 0)
 
bool m_RefreshChart = false
 
bool m_ForceOpenRaycastTarget
 
bool m_IsControlledByLayout = false
 
bool m_PainerDirty = false
 
bool m_IsOnValidate = false
 
Vector3 m_LastLocalPosition
 
Action< PointerEventData, BaseGraphm_OnPointerClick
 
Action< PointerEventData, BaseGraphm_OnPointerDown
 
Action< PointerEventData, BaseGraphm_OnPointerUp
 
Action< PointerEventData, BaseGraphm_OnPointerEnter
 
Action< PointerEventData, BaseGraphm_OnPointerExit
 
Action< PointerEventData, BaseGraphm_OnBeginDrag
 
Action< PointerEventData, BaseGraphm_OnDrag
 
Action< PointerEventData, BaseGraphm_OnEndDrag
 
Action< PointerEventData, BaseGraphm_OnScroll
 

Static Protected Attributes

static readonly string s_BackgroundObjectName = "background"
 

Properties

Background background [get]
 The background component. 背景组件。 More...
 
float graphX [get]
 The x of graph. 图形的X More...
 
float graphY [get]
 The y of graph. 图形的Y More...
 
float graphWidth [get]
 The width of graph. 图形的宽 More...
 
float graphHeight [get]
 The height of graph. 图形的高 More...
 
Vector3 graphPosition [get]
 The position of graph. 图形的左下角起始坐标。 More...
 
Rect graphRect [get]
 
Vector2 pointerPos [get, protected set]
 The postion of pointer. 鼠标位置。 More...
 
bool isPointerInChart [get, protected set]
 Whether the mouse pointer is in the chart. 鼠标是否在图表内。 More...
 
string warningInfo [get, protected set]
 警告信息。 More...
 
bool isControlledByLayout [get]
 
bool forceOpenRaycastTarget [get, set]
 强制开启鼠标事件检测。 More...
 
Action< PointerEventData, BaseGraphonPointerClick [set]
 鼠标点击回调。 More...
 
Action< PointerEventData, BaseGraphonPointerDown [set]
 鼠标按下回调。 More...
 
Action< PointerEventData, BaseGraphonPointerUp [set]
 鼠标弹起回调。 More...
 
Action< PointerEventData, BaseGraphonPointerEnter [set]
 鼠标进入回调。 More...
 
Action< PointerEventData, BaseGraphonPointerExit [set]
 鼠标退出回调。 More...
 
Action< PointerEventData, BaseGraphonBeginDrag [set]
 鼠标开始拖拽回调。 More...
 
Action< PointerEventData, BaseGraphonDrag [set]
 鼠标拖拽回调。 More...
 
Action< PointerEventData, BaseGraphonEndDrag [set]
 鼠标结束拖拽回调。 More...
 
Action< PointerEventData, BaseGraphonScroll [set]
 鼠标滚动回调。 More...
 
Vector2 graphAnchorMax [get]
 
Vector2 graphAnchorMin [get]
 
Vector2 graphPivot [get]
 
HideFlags? chartHideFlags [get]
 

Detailed Description

The base class of all graphs or components. 所有图形的基类。

Definition at line 18 of file BaseGraph_API.cs.

Member Function Documentation

◆ CheckWarning()

string XCharts.BaseGraph.CheckWarning ( )
inline

检测警告信息。

Returns

Definition at line 152 of file BaseGraph_API.cs.

153  {
154  warningInfo = CheckHelper.CheckChart(this);
155  return warningInfo;
156  }

◆ RefreshGraph()

void XCharts.BaseGraph.RefreshGraph ( )
inline

Redraw graph in next frame. 在下一帧刷新图形。

Definition at line 137 of file BaseGraph_API.cs.

138  {
139  m_RefreshChart = true;
140  }

◆ RemoveChartObject()

void XCharts.BaseGraph.RemoveChartObject ( )
inline

移除所有图表子节点,会自动重现初始化。

Definition at line 161 of file BaseGraph_API.cs.

162  {
163  ChartHelper.DestroyAllChildren(transform);
164  //SetAllComponentDirty();
165  }

◆ SetPainterDirty()

void XCharts.BaseGraph.SetPainterDirty ( )
inline

重新初始化Painter

Definition at line 128 of file BaseGraph_API.cs.

129  {
130  m_PainerDirty = true;
131  }

◆ SetSize()

virtual void XCharts.BaseGraph.SetSize ( float  width,
float  height 
)
inlinevirtual

设置图形的宽高(在非stretch pivot下才有效,其他情况需要自己调整RectTransform)

Parameters
width
height

Definition at line 113 of file BaseGraph_API.cs.

114  {
115  if (LayerHelper.IsFixedWidthHeight(rectTransform))
116  {
117  rectTransform.sizeDelta = new Vector2(width, height);
118  }
119  else
120  {
121  Debug.LogError("Can't set size on stretch pivot,you need to modify rectTransform by yourself.");
122  }
123  }

Property Documentation

◆ background

Background XCharts.BaseGraph.background
get

The background component. 背景组件。

Definition at line 25 of file BaseGraph_API.cs.

25 { get { return m_Background; } }

◆ forceOpenRaycastTarget

bool XCharts.BaseGraph.forceOpenRaycastTarget
getset

强制开启鼠标事件检测。

Definition at line 70 of file BaseGraph_API.cs.

70 { get { return m_ForceOpenRaycastTarget; } set { m_ForceOpenRaycastTarget = value; } }

◆ graphHeight

float XCharts.BaseGraph.graphHeight
get

The height of graph. 图形的高

Definition at line 45 of file BaseGraph_API.cs.

45 { get { return m_GraphHeight; } }

◆ graphPosition

Vector3 XCharts.BaseGraph.graphPosition
get

The position of graph. 图形的左下角起始坐标。

Definition at line 50 of file BaseGraph_API.cs.

50 { get { return m_GraphPosition; } }

◆ graphWidth

float XCharts.BaseGraph.graphWidth
get

The width of graph. 图形的宽

Definition at line 40 of file BaseGraph_API.cs.

40 { get { return m_GraphWidth; } }

◆ graphX

float XCharts.BaseGraph.graphX
get

The x of graph. 图形的X

Definition at line 30 of file BaseGraph_API.cs.

30 { get { return m_GraphX; } }

◆ graphY

float XCharts.BaseGraph.graphY
get

The y of graph. 图形的Y

Definition at line 35 of file BaseGraph_API.cs.

35 { get { return m_GraphY; } }

◆ isPointerInChart

bool XCharts.BaseGraph.isPointerInChart
getprotected set

Whether the mouse pointer is in the chart. 鼠标是否在图表内。

Definition at line 61 of file BaseGraph_API.cs.

61 { get; protected set; }

◆ onBeginDrag

Action<PointerEventData, BaseGraph> XCharts.BaseGraph.onBeginDrag
set

鼠标开始拖拽回调。

Definition at line 94 of file BaseGraph_API.cs.

94 { set { m_OnBeginDrag = value; m_ForceOpenRaycastTarget = true; } }

◆ onDrag

Action<PointerEventData, BaseGraph> XCharts.BaseGraph.onDrag
set

鼠标拖拽回调。

Definition at line 98 of file BaseGraph_API.cs.

98 { set { m_OnDrag = value; m_ForceOpenRaycastTarget = true; } }

◆ onEndDrag

Action<PointerEventData, BaseGraph> XCharts.BaseGraph.onEndDrag
set

鼠标结束拖拽回调。

Definition at line 102 of file BaseGraph_API.cs.

102 { set { m_OnEndDrag = value; m_ForceOpenRaycastTarget = true; } }

◆ onPointerClick

Action<PointerEventData, BaseGraph> XCharts.BaseGraph.onPointerClick
set

鼠标点击回调。

Definition at line 74 of file BaseGraph_API.cs.

74 { set { m_OnPointerClick = value; m_ForceOpenRaycastTarget = true; } }

◆ onPointerDown

Action<PointerEventData, BaseGraph> XCharts.BaseGraph.onPointerDown
set

鼠标按下回调。

Definition at line 78 of file BaseGraph_API.cs.

78 { set { m_OnPointerDown = value; m_ForceOpenRaycastTarget = true; } }

◆ onPointerEnter

Action<PointerEventData, BaseGraph> XCharts.BaseGraph.onPointerEnter
set

鼠标进入回调。

Definition at line 86 of file BaseGraph_API.cs.

86 { set { m_OnPointerEnter = value; m_ForceOpenRaycastTarget = true; } }

◆ onPointerExit

Action<PointerEventData, BaseGraph> XCharts.BaseGraph.onPointerExit
set

鼠标退出回调。

Definition at line 90 of file BaseGraph_API.cs.

90 { set { m_OnPointerExit = value; m_ForceOpenRaycastTarget = true; } }

◆ onPointerUp

Action<PointerEventData, BaseGraph> XCharts.BaseGraph.onPointerUp
set

鼠标弹起回调。

Definition at line 82 of file BaseGraph_API.cs.

82 { set { m_OnPointerUp = value; m_ForceOpenRaycastTarget = true; } }

◆ onScroll

Action<PointerEventData, BaseGraph> XCharts.BaseGraph.onScroll
set

鼠标滚动回调。

Definition at line 106 of file BaseGraph_API.cs.

106 { set { m_OnScroll = value; m_ForceOpenRaycastTarget = true; } }

◆ pointerPos

Vector2 XCharts.BaseGraph.pointerPos
getprotected set

The postion of pointer. 鼠标位置。

Definition at line 56 of file BaseGraph_API.cs.

56 { get; protected set; }

◆ warningInfo

string XCharts.BaseGraph.warningInfo
getprotected set

警告信息。

Definition at line 65 of file BaseGraph_API.cs.

65 { get; protected set; }

The documentation for this class was generated from the following files:
XCharts.BaseGraph.warningInfo
string warningInfo
警告信息。
Definition: BaseGraph_API.cs:65