/// <summary> /// 指定のエレメントが下に移動できるかチェックする処理 /// </summary> /// <param name="clElem">エレメント</param> /// <returns>移動可能フラグ</returns> public bool CanMoveDown(ClsDatElem clElem) { if (clElem == null) { return(false); } if (this.mListElem == null) { return(false); } if (this.mListElem.Count <= 0) { return(false); } int inHashCode1 = clElem.GetHashCode(); ClsDatElem clElemEnd = this.mListElem[this.mListElem.Count - 1] as ClsDatElem; int inHashCode2 = clElemEnd.GetHashCode(); if (inHashCode1 == inHashCode2) { return(false); } return(true); }
private void panel_Control_MouseUp(object sender, MouseEventArgs e) { ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { return; } //以下、エレメントをドロップする処理 if (e.Button == MouseButtons.Left) { if (this.mFormDragLabel != null) { if (!this.mFormDragLabel.IsDisposed) { bool isHit = false; //以下、子供として登録する処理 ClsDatElem clElemBase = clMotion.FindElemFromMark(EnmMarkElement.IN); if (clElemBase != null) { ClsDatElem clElem = this.mFormDragLabel.GetElem(); clElemBase.AddElemChild(clElem); isHit = true; } //以下、自分の兄として登録する処理 clElemBase = clMotion.FindElemFromMark(EnmMarkElement.UP); if (clElemBase != null) { ClsDatElem clElem = this.mFormDragLabel.GetElem(); clElemBase.AddElemBigBrother(clElem); isHit = true; } //以下、行番号割り振り処理 if (isHit) { clMotion.RefreshLineNo(); } } this.mFormDragLabel.Close(); this.mFormDragLabel.Dispose(); this.mFormDragLabel = null; } //以下、マークをクリアする処理 clMotion.ClearInsertMark(); //以下、コントロール更新処理 this.RefreshControl(); this.panel_Control.Refresh(); this.panel_Time.Refresh(); this.mFormMain.Refresh(); } }
/// <summary> /// エレメント情報変更処理 /// </summary> /// <param name="clElem">変更対象となるエレメント</param> /// <param name="enTypeOption">オプションタイプ</param> /// <param name="inSelectFrameNo">フレーム番号</param> /// <param name="isExistKeyFrame">キーフレーム存在フラグ</param> /// <param name="isEnable1">有効フラグ1</param> /// <param name="isEnable2">有効フラグ2</param> /// <param name="clTween1">トゥイーン1</param> /// <param name="clTween2">トゥイーン2</param> /// <param name="clValue1">値1</param> /// <param name="clValue2">値2</param> private void ChangeElem(ClsDatElem clElem, EnmTypeOption enTypeOption, int inSelectFrameNo, bool isExistKeyFrame, bool isEnable1, bool isEnable2, ClsDatTween clTween1, ClsDatTween clTween2, object clValue1, object clValue2) { ClsDatOption clOption = null; if (inSelectFrameNo == 0) { clElem.SetOption(enTypeOption, isEnable1, isEnable2, clTween1, clTween2, clValue1, clValue2); } else { bool isExist = clElem.IsExistOption(enTypeOption); if (isExist) { clOption = clElem.GetOption(enTypeOption); } else { clValue1 = ClsParam.GetDefaultValue1(enTypeOption); clValue2 = ClsParam.GetDefaultValue2(enTypeOption); clElem.SetOption(enTypeOption, isEnable1, isEnable2, clTween1, clTween2, clValue1, clValue2); clOption = clElem.GetOption(enTypeOption); } if (isExistKeyFrame) { clOption.SetKeyFrame(inSelectFrameNo, isEnable1, isEnable2, clTween1, clTween2, clValue1, clValue2); //追加または更新 } else { clOption.RemoveKeyFrame(inSelectFrameNo); } } }
private void ToolStripMenuItem_Add_Click(object sender, EventArgs e) { ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { return; } ClsDatElem clElem = ClsSystem.GetElemFromSelectLineNo(); if (clElem == null) { return; } //以下、オプション追加処理 ToolStripMenuItem clITem = sender as ToolStripMenuItem; EnmTypeOption enTypeOption = (EnmTypeOption)clITem.Tag; object clValue1 = ClsParam.GetDefaultValue1(enTypeOption); object clValue2 = ClsParam.GetDefaultValue2(enTypeOption); clElem.SetOption(enTypeOption, false, false, null, null, clValue1, clValue2); //以下、行番号振り直し処理 clMotion.RefreshLineNo(); //以下、コントロール更新処理 this.RefreshControl(); this.panel_Control.Refresh(); this.panel_Time.Refresh(); this.mFormMain.Refresh(); }
/// <summary> /// 行番号からエレメントを取得する /// その行がオプションの場合は、その親のエレメントを取得する /// </summary> /// <param name="inLineNo">行番号</param> /// <returns>行番号のエレメント</returns> public static ClsDatElem GetElemFromLineNo(int inLineNo) { if (inLineNo < 0) { return(null); } ClsDatItem clItem = ClsSystem.GetItemFromLineNo(inLineNo); if (clItem == null) { return(null); } if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.ELEM) { ClsDatElem clElem = clItem as ClsDatElem; return(clElem); } else if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.OPTION) { ClsDatOption clOption = clItem as ClsDatOption; ClsDatElem clElem = clOption.mElemParent; return(clElem); } return(null); }
/// <summary> /// 行番号からオプションを取得する /// </summary> /// <param name="inLineNo">行番号</param> /// <returns>行番号のオプション</returns> public static ClsDatOption GetOptionFromLineNo(int inLineNo) { ClsDatItem clItem = ClsSystem.GetItemFromLineNo(inLineNo); if (clItem == null) { return(null); } ClsDatOption clOption = null; bool isExist; if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.ELEM) { ClsDatElem clElem = clItem as ClsDatElem; if (clElem == null) { return(null); } isExist = clElem.mDicOption.ContainsKey(EnmTypeOption.DISPLAY); if (!isExist) { return(null); } clOption = clElem.mDicOption[EnmTypeOption.DISPLAY]; } else if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.OPTION) { clOption = clItem as ClsDatOption; } return(clOption); }
/// <summary> /// モーションのタイムライン描画処理 /// </summary> /// <param name="g">描画管理クラス</param> /// <param name="inWidth">描画先の幅</param> /// <param name="inHeight">描画先の高さ</param> public void DrawTime(Graphics g, int inWidth, int inHeight) { int inLineNo = ClsSystem.GetSelectLineNo(); int inFrameNo = ClsSystem.GetSelectFrameNo(); //以下、選択中フレームのラインを表示する処理 Brush clBrush = new SolidBrush(Color.DarkGreen); int inX = inFrameNo * FormControl.CELL_WIDTH; g.FillRectangle(clBrush, inX, 0, FormControl.CELL_WIDTH, inHeight); //以下、エレメント描画処理 int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { ClsDatElem clElem = this.mListElem[inCnt]; clElem.DrawTime(g, inLineNo, inFrameNo, this.mMaxFrameNum, inWidth, inHeight); } //以下、最終フレームの境界線描画処理 Pen clPen = new Pen(Color.Green); inX = this.mMaxFrameNum * FormControl.CELL_WIDTH; g.DrawLine(clPen, inX, 0, inX, inHeight); }
private void panel_Control_MouseClick(object sender, MouseEventArgs e) { ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { return; } //以下、アイテム選択処理 int inLineNo = this.GetLineNoFromPositionY(e.Y); ClsSystem.SetSelectFromLineNo(inLineNo); ClsDatElem clElem = ClsSystem.GetElemFromLineNo(inLineNo); if (clElem != null) { if (inLineNo == clElem.mLineNo) { //Click Eye if (0 <= e.X && e.X < 17) { clElem.isDisplay = !clElem.isDisplay; } //Click Parent if (17 <= e.X && e.X < 34) { if (clElem.mElem != null) { clElem.isParent = !clElem.isParent; } } //Click Locked if (34 <= e.X && e.X < 51) { clElem.isLocked = !clElem.isLocked; } //Attribute Open if (51 <= e.X && e.X < 68) { clElem.isOpen = !clElem.isOpen; clMotion.RefreshLineNo(); //行番号とタブを割り振る処理 } } } //以下、コントロール更新処理 this.RefreshControl(); this.panel_Control.Refresh(); this.panel_Time.Refresh(); this.mFormMain.Refresh(); }
/// <summary> /// オプションの情報を修正する処理 /// </summary> /// <param name="clParam">パラメーター情報</param> public void ChangeElemFromParam(ClsParam clParam) { ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { return; } ClsDatElem clElem = ClsSystem.GetElemFromSelectLineNo(); if (clElem == null) { return; } int inSelectFrameNo = ClsSystem.GetSelectFrameNo(); //以下、表示設定 object clValue2 = ClsParam.GetDefaultValue2(EnmTypeOption.DISPLAY); this.ChangeElem(clElem, EnmTypeOption.DISPLAY, inSelectFrameNo, clParam.mDisplayKeyFrame, false, false, null, null, clParam.mDisplay, clValue2); //以下、座標設定 this.ChangeElem(clElem, EnmTypeOption.POSITION, inSelectFrameNo, clParam.mPositionKeyFrame, clParam.mPositionXTween, clParam.mPositionYTween, clParam.mTweenPositionX, clParam.mTweenPositionY, clParam.mX, clParam.mY); //以下、回転設定 clValue2 = ClsParam.GetDefaultValue2(EnmTypeOption.ROTATION); this.ChangeElem(clElem, EnmTypeOption.ROTATION, inSelectFrameNo, clParam.mRotationKeyFrame, clParam.mRotationTween, false, clParam.mTweenRotation, null, clParam.mRZ, clValue2); //以下、スケール設定 this.ChangeElem(clElem, EnmTypeOption.SCALE, inSelectFrameNo, clParam.mScaleKeyFrame, clParam.mScaleXTween, clParam.mScaleYTween, clParam.mTweenScaleX, clParam.mTweenScaleY, clParam.mSX, clParam.mSY); //以下、オフセット設定 this.ChangeElem(clElem, EnmTypeOption.OFFSET, inSelectFrameNo, clParam.mOffsetKeyFrame, clParam.mOffsetXTween, clParam.mOffsetYTween, clParam.mTweenOffsetX, clParam.mTweenOffsetY, clParam.mCX, clParam.mCY); //以下、反転設定 this.ChangeElem(clElem, EnmTypeOption.FLIP, inSelectFrameNo, clParam.mFlipKeyFrame, false, false, null, null, clParam.mFlipH, clParam.mFlipV); //以下、透明設定 clValue2 = ClsParam.GetDefaultValue2(EnmTypeOption.TRANSPARENCY); this.ChangeElem(clElem, EnmTypeOption.TRANSPARENCY, inSelectFrameNo, clParam.mTransKeyFrame, clParam.mTransTween, false, clParam.mTweenTrans, null, clParam.mTrans, clValue2); //以下、カラー設定 clValue2 = ClsParam.GetDefaultValue2(EnmTypeOption.COLOR); this.ChangeElem(clElem, EnmTypeOption.COLOR, inSelectFrameNo, clParam.mColorKeyFrame, clParam.mColorTween, false, clParam.mTweenColor, null, clParam.mColor, clValue2); //以下、ユーザーデータ設定 clValue2 = ClsParam.GetDefaultValue2(EnmTypeOption.USER_DATA); this.ChangeElem(clElem, EnmTypeOption.USER_DATA, inSelectFrameNo, clParam.mUserDataKeyFrame, false, false, null, null, clParam.mUserData, clValue2); //以下、行番号を振り直す処理 clMotion.RefreshLineNo(); //以下、メインウィンドウ更新処理 this.mFormMain.RefreshAll(); }
public FormDragLabel(ClsDatElem clElem) { InitializeComponent(); //以下、初期化処理 this.mElem = clElem; //以下、ウィンドウ移動処理 this.MoveWindowNearMouse(); }
/// <summary> /// デフォルトの親に影響を受けるかどうか /// </summary> /// <param name="clElem">親エレメント</param> /// <param name="enTypeOption">オプションタイプ</param> /// <returns>デフォルトの値</returns> public static bool GetDefaultParentFlag(ClsDatElem clElem, EnmTypeOption enTypeOption) { if (clElem == null) { return(false); } bool isParent = false; switch (enTypeOption) { case EnmTypeOption.NONE: isParent = false; break; case EnmTypeOption.DISPLAY: isParent = true; break; case EnmTypeOption.POSITION: isParent = true; break; case EnmTypeOption.ROTATION: isParent = true; break; case EnmTypeOption.SCALE: isParent = true; break; case EnmTypeOption.OFFSET: isParent = false; break; case EnmTypeOption.FLIP: isParent = true; break; case EnmTypeOption.TRANSPARENCY: isParent = true; break; case EnmTypeOption.COLOR: isParent = false; break; case EnmTypeOption.USER_DATA: isParent = false; break; } return(isParent); }
/// <summary> /// 挿入可能マークのクリア /// </summary> public void ClearInsertMark() { //以下、子エレメントの挿入マークを消す処理 int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { ClsDatElem clElem = this.mListElem[inCnt]; clElem.ClearInsertMark(); } }
/// <summary> /// モーションの全てを削除する処理 /// </summary> public void Remove() { //以下、エレメント全削除処理 int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { ClsDatElem clElem = this.mListElem[inCnt]; clElem.RemoveAll(); } this.mListElem.Clear(); }
/// <summary> /// 現在選択中のエレメントを取得する /// オプションを選択中の場合は、その親のエレメントを取得する /// </summary> /// <returns>現在選択中のエレメント</returns> public static ClsDatElem GetElemFromSelectLineNo() { int inLineNo = ClsSystem.GetSelectLineNo(); if (inLineNo < 0) { return(null); } ClsDatElem clElem = ClsSystem.GetElemFromLineNo(inLineNo); return(clElem); }
private Dictionary <int, ClsDatKeyFrame> mDicKeyFrame; //キーはフレーム番号 値はキーフレーム管理クラス /// <summary> /// コンストラクタ /// </summary> /// <param name="clElemParent">親エレメント</param> /// <param name="enType">オプションタイプ</param> /// <param name="isEnable1">有効フラグ1</param> /// <param name="isEnable2">有効フラグ2</param> /// <param name="clTween1">トゥイーン1</param> /// <param name="clTween2">トゥイーン2</param> /// <param name="clValue1">初期状態の値1</param> /// <param name="clValue2">初期状態の値2</param> public ClsDatOption(ClsDatElem clElemParent, EnmTypeOption enTypeOption, bool isEnable1, bool isEnable2, ClsDatTween clTween1, ClsDatTween clTween2, object clValue1, object clValue2) { this.mTypeItem = TYPE_ITEM.OPTION; this.mElemParent = clElemParent; this.mTypeOption = enTypeOption; this.mDicKeyFrame = new Dictionary <int, ClsDatKeyFrame>(); //以下、0フレーム目にキーフレームを登録する処理(0フレーム目には必ずキーフレームが存在する) ClsDatKeyFrame clKeyFrame = new ClsDatKeyFrame(enTypeOption, 0, isEnable1, isEnable2, clTween1, clTween2, clValue1, clValue2); this.mDicKeyFrame.Add(0, clKeyFrame); }
/// <summary> /// ウィンドウ名取得処理 /// </summary> /// <param name="clWindowName">ウィンドウ名</param> /// <param name="clElem">エレメント管理クラス</param> /// <param name="inSelectFrameNo">選択中のフレーム番号</param> /// <returns>ウィンドウ名</returns> public static string GetWindowName(string clWindowName, ClsDatElem clElem, int inSelectFrameNo) { string clName = ""; if (clElem != null && clElem.mMotion != null) { clName = " ( " + clElem.mMotion.mName + " [ " + clElem.mName + " , " + inSelectFrameNo + " ] )"; } string clResultName = clWindowName + clName; return(clResultName); }
/// <summary> /// モーションのコントロール描画処理 /// </summary> /// <param name="g">描画管理クラス</param> /// <param name="inWidth">描画先の幅</param> /// <param name="inHeight">描画先の高さ</param> /// <param name="clFont">フォント管理クラス</param> public void DrawControl(Graphics g, int inWidth, int inHeight, Font clFont) { int inLineNo = ClsSystem.GetSelectLineNo(); //以下、エレメント描画処理 int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { ClsDatElem clElem = this.mListElem[inCnt]; clElem.DrawControl(g, inLineNo, inWidth, inHeight, clFont); } }
private void button_ItemDown_Click(object sender, EventArgs e) { ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { return; } int inLineNo = ClsSystem.GetSelectLineNo(); if (inLineNo < 0) { return; } ClsDatItem clItem = clMotion.GetItemFromLineNo(inLineNo); if (clItem == null) { return; } if (clItem.mTypeItem != ClsDatItem.TYPE_ITEM.ELEM) { return; } //以下、一つ下に移動する処理 ClsDatElem clElem = clItem as ClsDatElem; if (clElem.mElem == null) { clMotion.MoveDown(clElem); } else { clElem.mElem.MoveElemDown(clElem); } //以下、行番号振り直し処理 clMotion.RefreshLineNo(); //以下、改めてアイテムを選択する処理 ClsSystem.SetSelectFromLineNo(clItem.mLineNo); //上記の RefreshLineNo 関数内でmLineNoが変わっているはず //以下、コントロール更新処理 this.RefreshControl(); this.panel_Control.Refresh(); this.panel_Time.Refresh(); this.mFormMain.Refresh(); }
/// <summary> /// 行番号割り振り処理 /// </summary> public void RefreshLineNo() { this.mWorkLineNo = 0; int inTab = 0; int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { ClsDatElem clElem = this.mListElem[inCnt]; clElem.mTab = inTab; clElem.RefreshLineNo(this, inTab + 1); } }
private void panel_Control_MouseDoubleClick(object sender, MouseEventArgs e) { ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { return; } //Item選択 int inLineNo = this.GetLineNoFromPositionY(e.Y); //以下、エレメント選択処理 ClsSystem.SetSelectFromLineNo(inLineNo); //Item最大数を確認 ClsDatElem clElem = ClsSystem.GetElemFromLineNo(inLineNo); if (clElem != null) { if (e.X > 69) { //以下、テキストボックス削除処理 this.RemoveTextBoxName(); //以下、テキストボックス生成処理 this.mTextBox = new TextBox(); this.mTextBox.Location = new System.Drawing.Point(69, inLineNo * FormControl.CELL_HEIGHT - 1); this.mTextBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); this.mTextBox.MaxLength = ClsDatElem.MAX_NAME; this.mTextBox.Text = clElem.GetName(); this.mTextBox.Name = "textBox_Name"; this.mTextBox.Size = new System.Drawing.Size(80, 19); this.mTextBox.Tag = inLineNo; this.mTextBox.TabIndex = 0; this.mTextBox.Leave += new System.EventHandler(this.textBox_Name_Leave); this.mTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox_Name_KeyDown); this.panel_Control.Controls.Add(this.mTextBox); this.mTextBox.Focus(); } } //以下、コントロール更新処理 this.RefreshControl(); this.panel_Control.Refresh(); this.panel_Time.Refresh(); this.mFormMain.Refresh(); }
/// <summary> /// 行番号からオプションを削除する処理 /// ※これを読んだ後は ClsDatMotion.RefreshLineNo を呼んで行番号を割り振りなおさなければならない /// </summary> /// <param name="inLineNo">行番号</param> /// <param name="isForce">強制フラグ</param> /// <param name="isRemove">実体削除フラグ</param> public void RemoveOptionFromLineNo(int inLineNo, bool isForce, bool isRemove) { if (inLineNo < 0) { return; } int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { ClsDatElem clElem = this.mListElem[inCnt]; clElem.RemoveOptionFromLineNo(inLineNo, isForce, isRemove); } }
/// <summary> /// プレビュー上のパーツの描画処理 /// </summary> /// <param name="clGL">OpenGLコンポーネント</param> /// <param name="inFrameNo">フレーム番号</param> /// <param name="inMaxFrameNum">フレーム数</param> public void DrawPreview(ComponentOpenGL clGL, int inFrameNo, int inMaxFrameNum) { int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { //以下、マトリクス初期化処理 float[] pflMat = clGL.InitElemMatrix(); //以下、エレメント描画処理 ClsDatElem clElem = this.mListElem[inCnt]; ClsParam clParam = new ClsParam(); clElem.DrawPreview(clGL, inFrameNo, inMaxFrameNum, clParam, pflMat); } }
/// <summary> /// インデックスからエレメントを削除する処理 /// ※これを読んだ後は ClsDatMotion.RefreshLineNo を呼んで行番号を割り振りなおさなければならない /// </summary> /// <param name="inIndex">インデックス</param> public void RemoveElemFromIndex(int inIndex) { if (inIndex < 0) { return; } if (inIndex >= this.mListElem.Count) { return; } ClsDatElem clElem = this.mListElem[inIndex]; clElem.RemoveAll(); this.mListElem.RemoveAt(inIndex); }
/// <summary> /// 選択中のキーフレームを取得する処理 /// </summary> /// <returns>選択中のキーフレーム</returns> private static ClsDatKeyFrame GetKeyFrameFromSelectFrame() { ClsDatItem clItem = ClsSystem.GetItemFromSelectLineNo(); if (clItem == null) { return(null); } //以下、エレメント設定 ClsDatElem clElem = null; ClsDatOption clOption = null; if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.ELEM) { clElem = clItem as ClsDatElem; clOption = clElem.mDicOption[EnmTypeOption.DISPLAY]; } else if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.OPTION) { clOption = clItem as ClsDatOption; clElem = clOption.mElemParent; } if (clOption == null) { return(null); } int inIndex = ClsSystem.GetSelectFrameNo(); if (inIndex != 0) { bool isExist = clOption.IsExistKeyFrame(inIndex); if (!isExist) { return(null); } } //以下、キーフレーム取得処理 ClsDatKeyFrame clKeyFrame = clOption.GetKeyFrame(inIndex); return(clKeyFrame); }
/// <summary> /// エレメント検索処理 /// </summary> /// <param name="clElem">エレメント</param> /// <returns>インデックス</returns> public int FindIndexFromElem(ClsDatElem clElem) { int inHashCode1 = clElem.GetHashCode(); int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { ClsDatElem clElemTmp = this.mListElem[inCnt]; int inHashCode2 = clElemTmp.GetHashCode(); if (inHashCode1 == inHashCode2) { return(inCnt); } } return(-1); }
/// <summary> /// 行番号からアイテムを検索する処理 /// </summary> /// <param name="inLineNo">行番号</param> /// <returns>アイテム</returns> public ClsDatItem FindItemFromLineNo(int inLineNo) { this.mWorkItem = null; int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { ClsDatElem clElem = this.mListElem[inCnt]; clElem.FindItemFromLineNo(this, inLineNo); if (this.mWorkItem != null) { return(this.mWorkItem); } } return(null); }
/// <summary> /// 挿入可能マークからエレメントを検索する処理 /// </summary> /// <param name="enMark">挿入可能マーク</param> /// <returns>エレメント</returns> public ClsDatElem FindElemFromMark(EnmMarkElement enMark) { this.mWorkElem = null; int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { ClsDatElem clElem = this.mListElem[inCnt]; clElem.FindElemFromMark(this, enMark); if (this.mWorkElem != null) { return(this.mWorkElem); } } return(null); }
/// <summary> /// 行番号からエレメントを削除する処理 /// ※これを読んだ後は ClsDatMotion.RefreshLineNo を呼んで行番号を割り振りなおさなければならない /// </summary> /// <param name="inLineNo">行番号</param> /// <param name="isRemove">実体削除フラグ</param> public void RemoveElemFromLineNo(int inLineNo, bool isRemove) { if (inLineNo < 0) { return; } int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { ClsDatElem clElem = this.mListElem[inCnt]; if (inLineNo == clElem.mLineNo) { this.RemoveElemFromIndex(inCnt); return; } clElem.RemoveElemFromLineNo(inLineNo, isRemove); } }
/// <summary> /// 読み込み処理 /// </summary> /// <param name="clXmlElem">xmlエレメント</param> public void Load(XmlElement clXmlElem) { XmlNodeList clListNode = clXmlElem.ChildNodes; this.mID = ClsTool.GetIntFromXmlNodeList(clListNode, "ID"); this.mName = ClsTool.GetStringFromXmlNodeList(clListNode, "Name"); this.mMaxFrameNum = ClsTool.GetIntFromXmlNodeList(clListNode, "FrameNum"); //以下、各管理クラス作成処理 foreach (XmlNode clNode in clListNode) { if ("Elem".Equals(clNode.Name)) { ClsDatElem clDatElem = new ClsDatElem(this, null, 0.0f, 0.0f); clDatElem.Load(clNode); this.mListElem.Add(clDatElem); continue; } } }
private void ToolStripMenuItem_AddKeyFrame_Click(object sender, EventArgs e) { int inIndex = (int)this.numericUpDown_NowFlame.Value; if (inIndex <= 0) { return; //0フレーム目には作成できない } ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { return; } ClsDatOption clOption = ClsSystem.GetOptionFromSelectLineNo(); if (clOption == null) { return; } //以下、キーフレーム作成・更新処理 ClsDatElem clElem = clOption.mElemParent; bool isParentFlag = ClsParam.GetDefaultParentFlag(clElem.mElem, clOption.mTypeOption); //以下、現在の値を取得する処理 object clValue1 = clOption.GetValue1(inIndex); object clValue2 = clOption.GetValue2(inIndex); ClsDatKeyFrame clKeyFrame = new ClsDatKeyFrame(clOption.mTypeOption, inIndex, false, false, null, null, clValue1, clValue2); clOption.SetKeyFrame(inIndex, false, false, null, null, clValue1, clValue2); //存在していたら更新、存在していなかったら追加 //以下、コントロール更新処理 this.RefreshControl(); this.panel_Control.Refresh(); this.panel_Time.Refresh(); this.mFormMain.Refresh(); }