|
@@ -37,6 +37,7 @@ import { RemapNodeFactory } from './components/diagram/remap/remapNodeFactory';
|
|
import { RemapNodeModel } from './components/diagram/remap/remapNodeModel';
|
|
import { RemapNodeModel } from './components/diagram/remap/remapNodeModel';
|
|
import { RemapBlock } from 'babylonjs/Materials/Node/Blocks/remapBlock';
|
|
import { RemapBlock } from 'babylonjs/Materials/Node/Blocks/remapBlock';
|
|
import { GraphHelper } from './graphHelper';
|
|
import { GraphHelper } from './graphHelper';
|
|
|
|
+import { PreviewManager } from './previewManager';
|
|
|
|
|
|
require("storm-react-diagrams/dist/style.min.css");
|
|
require("storm-react-diagrams/dist/style.min.css");
|
|
require("./main.scss");
|
|
require("./main.scss");
|
|
@@ -66,6 +67,8 @@ export class GraphEditor extends React.Component<IGraphEditorProps> {
|
|
private _nodes = new Array<DefaultNodeModel>();
|
|
private _nodes = new Array<DefaultNodeModel>();
|
|
private _blocks = new Array<NodeMaterialBlock>();
|
|
private _blocks = new Array<NodeMaterialBlock>();
|
|
|
|
|
|
|
|
+ private _previewManager: PreviewManager;
|
|
|
|
+
|
|
/** @hidden */
|
|
/** @hidden */
|
|
public _toAdd: LinkModel[] | null = [];
|
|
public _toAdd: LinkModel[] | null = [];
|
|
|
|
|
|
@@ -127,6 +130,8 @@ export class GraphEditor extends React.Component<IGraphEditorProps> {
|
|
var widget = (this.refs["test"] as DiagramWidget);
|
|
var widget = (this.refs["test"] as DiagramWidget);
|
|
widget.setState({ document: this.props.globalState.hostDocument })
|
|
widget.setState({ document: this.props.globalState.hostDocument })
|
|
this.props.globalState.hostDocument!.addEventListener("keyup", widget.onKeyUpPointer as any, false);
|
|
this.props.globalState.hostDocument!.addEventListener("keyup", widget.onKeyUpPointer as any, false);
|
|
|
|
+
|
|
|
|
+ this._previewManager = new PreviewManager(this.props.globalState.hostDocument.getElementById("preview-canvas") as HTMLCanvasElement, this.props.globalState);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -135,6 +140,8 @@ export class GraphEditor extends React.Component<IGraphEditorProps> {
|
|
var widget = (this.refs["test"] as DiagramWidget);
|
|
var widget = (this.refs["test"] as DiagramWidget);
|
|
this.props.globalState.hostDocument!.removeEventListener("keyup", widget.onKeyUpPointer as any, false);
|
|
this.props.globalState.hostDocument!.removeEventListener("keyup", widget.onKeyUpPointer as any, false);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ this._previewManager.dispose();
|
|
}
|
|
}
|
|
|
|
|
|
constructor(props: IGraphEditorProps) {
|
|
constructor(props: IGraphEditorProps) {
|
|
@@ -472,7 +479,12 @@ export class GraphEditor extends React.Component<IGraphEditorProps> {
|
|
></div>
|
|
></div>
|
|
|
|
|
|
{/* Property tab */}
|
|
{/* Property tab */}
|
|
- <PropertyTabComponent globalState={this.props.globalState} />
|
|
|
|
|
|
+ <div className="right-panel">
|
|
|
|
+ <PropertyTabComponent globalState={this.props.globalState} />
|
|
|
|
+ <div id="preview">
|
|
|
|
+ <canvas id="preview-canvas"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
|
|
<LogComponent globalState={this.props.globalState} />
|
|
<LogComponent globalState={this.props.globalState} />
|
|
</div>
|
|
</div>
|