Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ public CaDoodleJsonOperationAdapterFactory() {
registerType("Lock", Lock.class);
registerType("MakeRobot", MakeRobot.class);
registerType("Mirror", Mirror.class);
registerType("MoveCenter", MoveCenter.class);
registerType("ModelNotes", ModelNotes.class);
registerType("ModifyLimb", ModifyLimb.class);
registerType("MoveCenter", MoveCenter.class);
registerType("Paste", Paste.class);
registerType("Resize", Resize.class);
registerType("Show", Show.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.neuronrobotics.bowlerstudio.scripting.cadoodle;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.annotations.Expose;
import com.neuronrobotics.sdk.addons.kinematics.math.TransformNR;

import eu.mihosoft.vrl.v3d.CSG;

public class ModelNotes extends CaDoodleOperation{
@Expose (serialize = true, deserialize = true)
TransformNR location=null;
@Expose (serialize = true, deserialize = true)
String text=null;

@Override
public String getType() {
return "ModelNotes";
}

@Override
public List<CSG> process(List<CSG> incoming) {
// no change to the models when adding a note
return incoming;
}

@Override
public List<String> getNamesAddedInThisOperation() {
return new ArrayList<String>();
}
public ModelNotes setLocation(TransformNR tf) {
location=tf;
return this;
}
public ModelNotes setText(String tx) {
text=tx;
return this;
}

}
8 changes: 8 additions & 0 deletions test/java/src/junit/bowler/CaDoodleWorkflowTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.eclipse.jgit.api.errors.TransportException;
import org.junit.Before;
import org.junit.Test;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
Expand All @@ -26,7 +27,9 @@

import com.neuronrobotics.bowlerstudio.scripting.cadoodle.AddFromScript;
import com.neuronrobotics.bowlerstudio.scripting.cadoodle.CaDoodleFile;
import com.neuronrobotics.bowlerstudio.scripting.cadoodle.CaDoodleOperation;
import com.neuronrobotics.bowlerstudio.scripting.cadoodle.Group;
import com.neuronrobotics.bowlerstudio.scripting.cadoodle.ModelNotes;
import com.neuronrobotics.bowlerstudio.scripting.cadoodle.MoveCenter;
import com.neuronrobotics.bowlerstudio.scripting.cadoodle.Paste;
import com.neuronrobotics.bowlerstudio.scripting.cadoodle.Resize;
Expand Down Expand Up @@ -257,6 +260,11 @@ public void test() throws Exception {
mr.setNames(selectAll);

loaded.addOpperation(mr).join();
ModelNotes setText = new ModelNotes()
.setLocation(new TransformNR(0, 0, 20))
.setText("A note is here");
loaded.addOpperation(setText).join();

loaded.save();
ScriptingEngine.pull(ControllerOption.URL_OF_OPTIONS);
ArrayList<ControllerOption> controllers = ControllerOption.getOptions();
Expand Down