This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Plugin from 'awv3/plugin/base'; | |
import Integration from 'awv3/plugin/integration'; | |
class MyPlugin extends Plugin { | |
constructor() { | |
super(); | |
// ... functionality | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application | |
canvas | |
scene | |
class VersatileObject(obj1) -> eventhandler | |
obj2 -> eventhandler | |
obj3 -> eventhandler | |
plugins | |
UI elements [selection] -> notify | |
pluginsystem->events->override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Plugin from 'awv3/session/plugin'; | |
import { Group, Button, Input, Label, Selection, Checkbox, Dropdown } from 'awv3/session/elements'; | |
export default class extends Plugin { | |
constructor(session, { name }) { | |
super(session, { type: "Measure", name }); | |
// 1. Elements SHOULD be created in the constructor. They can be stored in any way or form, | |
// in this case we use 'this' so that they are accessibable throuout the plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Session from 'awv3/session'; | |
// Create session | |
const session = window.session = new Session({ | |
debug: true, | |
connection: 'http://localhost:8181/' | |
}); | |
// Wait until we're connected | |
session.onConnected().then(server => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ALL material info (including opacity & color) is defined under a generialized "material" | |
// ALL properties are optional | |
// color & opacity will be removed from the protocol | |
material: { | |
type: BASIC | PHONG | LAMBERT | PHYSICAL | DASHED (lines only) | |
opacity: 0-1, | |
color: [0-255, 0-255, 0-255], | |
fog: true | false, // affected by fog | |
lights: true | false, // affected by lights |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cloneDeep from 'lodash/cloneDeep'; | |
import Session from 'awv3/session'; | |
// Create & export session | |
export const session = window.session = new Session({ material: 'multi' }); | |
// Export store | |
export const store = session.store; | |
// Mixin factory. Maps Redux props to Vue components | |
export const connect = (selector, props) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
globals.color { | |
objectHoverColor: ... | |
materialHoverColor: ... | |
} | |
Mesh.material = [{ ... }, {}, {}] || { ... } | |
const array = [...Mesh.material] | |
array.forEach( ... ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, applyMiddleware } from 'redux'; | |
import thunk from 'redux-thunk'; | |
import _ from 'lodash'; | |
// these types describe what i can do | |
const types = { | |
fetch: "ACTION_ADD", | |
remove: "ACTION_REMOVE" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Hello World</title> | |
<script src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script> | |
</head> | |
<body> |