Commit e486363f authored by Malte Heithoff's avatar Malte Heithoff
Browse files

bluePrintCPP changes

+ Different Includes Styles
+ new namespaces
+ new typedefs
- removed cvIncludes
parent 90f9b0b7
......@@ -4,9 +4,7 @@ package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTSubComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.InstanceInformation;
import de.monticore.lang.monticar.generator.EMAMBluePrint;
import de.monticore.lang.monticar.generator.Instruction;
import de.monticore.lang.monticar.generator.Variable;
import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.resolution._ast.ASTUnitNumberResolution;
import de.monticore.lang.monticar.si._symboltable.ResolutionDeclarationSymbol;
import de.se_rwth.commons.logging.Log;
......@@ -17,43 +15,75 @@ import java.util.List;
/**
*/
public class EMAMBluePrintCPP extends EMAMBluePrint {
public List<String> additionalIncludeStrings = new ArrayList<>();
public List<String> cvIncludeStrings = new ArrayList<>();
public static boolean usedCV = false;
private List<String> additionalUserIncludeStrings = new ArrayList<>();
private List<String> additionalStandardIncludeStrings = new ArrayList<>();
private List<String> additionalStandardIncludeStringsWithH = new ArrayList<>();
private List<String> additionalStandardIncludeStringsWithHPP = new ArrayList<>();
private List<String> additionalNameSpaceStrings = new ArrayList<>();
private List<String> additionalTypeDefStrings = new ArrayList<>();
// public List<String> cvIncludeStrings = new ArrayList<>();
private Method constructor;
public EMAMBluePrintCPP(String name) {
super(name);
}
public List<String> getAdditionalIncludeStrings() {
return additionalIncludeStrings;
public List<String> getAdditionalUserIncludeStrings() {
return additionalUserIncludeStrings;
}
public void addAdditionalIncludeString(String includeString) {
if (!hasAdditionalIncludeString(includeString))
additionalIncludeStrings.add(includeString);
public void addAdditionalUserIncludeStrings(String includeString) {
if (!hasAdditionalUserIncludeStrings(includeString))
additionalUserIncludeStrings.add(includeString);
}
public boolean hasAdditionalIncludeString(String includeString) {
return additionalIncludeStrings.contains(includeString);
public boolean hasAdditionalUserIncludeStrings(String includeString) {
return additionalUserIncludeStrings.contains(includeString);
}
public List<String> getCVIncludeStrings() {
return cvIncludeStrings;
public List<String> getAdditionalStandardIncludeStrings() {
return additionalStandardIncludeStrings;
}
public void addCVIncludeString(String includeString) {
if (!hasCVIncludeString(includeString)) {
cvIncludeStrings.add(includeString);
usedCV = true;
}
public void addAdditionalStandardInclude(String includeString) {
if (!this.additionalStandardIncludeStrings.contains(includeString))
this.additionalStandardIncludeStrings.add(includeString);
}
public List<String> getAdditionalStandardIncludeStringsWithH() {
return additionalStandardIncludeStringsWithH;
}
public void addAdditionalStandardIncludeStringWithH(String includeString) {
if (!this.additionalStandardIncludeStringsWithH.contains(includeString))
this.additionalStandardIncludeStringsWithH.add(includeString);
}
public void addAdditionalStandardIncludeStringWithHPP(String includeString) {
if (!this.additionalStandardIncludeStringsWithHPP.contains(includeString))
this.additionalStandardIncludeStringsWithHPP.add(includeString);
}
public boolean hasCVIncludeString(String includeString) {
return cvIncludeStrings.contains(includeString);
public List<String> getAdditionalStandardIncludeStringsWithHPP() {
return additionalStandardIncludeStringsWithHPP;
}
public List<String> getAdditionalNameSpaceStrings() {
return additionalNameSpaceStrings;
}
public void addAdditionalNameSpaceStrings(String nameSpaceString) {
this.additionalNameSpaceStrings.add(nameSpaceString);
}
public List<String> getAdditionalTypeDefStrings() {
return additionalTypeDefStrings;
}
public void addAdditionalTypeDefString(String typeDefString) {
this.additionalTypeDefStrings.add(typeDefString);
}
public List<String> getConsts() {
List<String> consts = new ArrayList<>();
......
......@@ -115,39 +115,39 @@ public class LanguageUnitCPP extends LanguageUnit {
resultString += "#include \"" + "HelperA" + ".h\"\n";
}
for (String string : bluePrint.getAdditionalIncludeStrings())
resultString += "#include \"" + string + ".h\"\n";
for(String includeName: bluePrint.getCVIncludeStrings())
if(!alreadyGeneratedCVIncludes.contains(includeName)) {
alreadyGeneratedCVIncludes.add(includeName);
if (includeName.contains("vector")) {
resultString += "#include <" + includeName + ">\n";
} else if (includeName.contains("ConvHelper")) {
resultString += "#include \"" + "ConvHelper" + ".h\"\n";
} else {
resultString += "#include <" + includeName + ".hpp>\n";
}
}
for (String string : bluePrint.getAdditionalUserIncludeStrings())
resultString += String.format("#include \"%s.h\"\n", string);
for (String string : bluePrint.getAdditionalStandardIncludeStrings())
resultString += String.format("#include <%s>\n", string);
for (String string : bluePrint.getAdditionalStandardIncludeStringsWithH())
resultString += String.format("#include <%s.h>\n", string);
for (String string : bluePrint.getAdditionalStandardIncludeStringsWithHPP())
resultString += String.format("#include <%s.hpp>\n", string);
if (generatorCPP.isExecutionLoggingActive)
resultString += "#include <fstream>\n";
for (String include : includeStrings) {
for (String include : includeStrings)
resultString += include;
}
if (generatorCPP.useThreadingOptimizations()) {
//if(MathConverter.curBackend.getBackendName().equals("OctaveBackend"))
//resultString+="#include \"mingw.thread.h\"\n";
//else if(MathConverter.curBackend.getBackendName().equals("ArmadilloBackend"))
resultString += "#include <thread>\n";
}
if (MathConverter.curBackend.getBackendName().equals("ArmadilloBackend")) {
if (MathConverter.curBackend.getBackendName().equals("ArmadilloBackend"))
resultString += "using namespace arma;\n";
}
if(!bluePrint.cvIncludeStrings.isEmpty()){
resultString += "using namespace std;\n";
}
for (String nameSpaceString : bluePrint.getAdditionalNameSpaceStrings())
resultString += String.format("using namespace %s;\n", nameSpaceString);
for (String typeDefString : bluePrint.getAdditionalTypeDefStrings())
resultString += String.format("typedef %s;\n", typeDefString);
// if(!bluePrint.cvIncludeStrings.isEmpty()){
// resultString += "using namespace std;\n";
// }
//class definition start
resultString += "class " + bluePrint.getName();
......
......@@ -98,7 +98,7 @@ public class MathFunctionFixer extends BaseMathFunctionFixerHandler {
.equals(((MathNameExpressionSymbol) mathExpressionSymbol).getNameToResolveValue())) {
ExecutionStepperHelper.setUsed();
((MathNameExpressionSymbol) mathExpressionSymbol).setNameToResolveValue("getCurrentTime()");
bluePrintCPP.addAdditionalIncludeString(ExecutionStepperHelper.FILENAME);
bluePrintCPP.addAdditionalUserIncludeStrings(ExecutionStepperHelper.FILENAME);
}
notHandled = false;
} else if (((MathValueExpressionSymbol) mathExpressionSymbol).isBooleanExpression()) {
......@@ -211,7 +211,7 @@ public class MathFunctionFixer extends BaseMathFunctionFixerHandler {
MathCommand mathCommand = bluePrintCPP.getMathCommandRegister().getMathCommand(mathExpressionSymbol.getNameToAccess());
if (mathCommand != null) {
if (MathConverter.curBackend.getBackendName().equals("OctaveBackend"))
bluePrintCPP.addAdditionalIncludeString("Helper");
bluePrintCPP.addAdditionalUserIncludeStrings("Helper");
mathCommand.convertAndSetTargetLanguageName(mathExpressionSymbol, bluePrintCPP);
}
if (fixForLoopAccess(mathExpressionSymbol, variable, bluePrintCPP)) {
......
......@@ -6,12 +6,13 @@ import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol
import de.monticore.lang.monticar.generator.EMAMBluePrint;
import de.monticore.lang.monticar.generator.MathCommand;
import de.monticore.lang.monticar.generator.cmake.CMakeFindModule;
import de.monticore.lang.monticar.generator.cpp.ConversionHelper;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......@@ -64,9 +65,10 @@ public class BoundingRectCommand extends MathCommand{
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
bluePrintCPP.addCVIncludeString("opencv2/imgproc/imgproc");
bluePrintCPP.addAdditionalStandardIncludeStringWithHPP("opencv2/imgproc/imgproc");
bluePrintCPP.getGenerator().getCmakeConfig()
.addModuleDependency(new CMakeFindModule("OpenCV", true).asFindAsPackage());
bluePrintCPP.addAdditionalNameSpaceStrings("std");
ConversionHelper.setUsedCV();
}
......
......@@ -5,13 +5,14 @@ import de.monticore.lang.math._symboltable.matrix.MathMatrixAccessSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cmake.CMakeFindModule;
import de.monticore.lang.monticar.generator.cpp.ConversionHelper;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.MathExpressionProperties;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......@@ -62,13 +63,14 @@ public class CvtColorCommand extends ArgumentNoReturnMathCommand{
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
bluePrintCPP.addCVIncludeString("opencv2/imgproc/imgproc");
bluePrintCPP.addCVIncludeString("ConvHelper");
bluePrintCPP.addAdditionalStandardIncludeStringWithHPP("opencv2/imgproc/imgproc");
bluePrintCPP.addAdditionalUserIncludeStrings("ConvHelper");
bluePrint.addMethod(cvtColorHelperMethod);
redefineArmaMat(bluePrintCPP);
redefineInit(bluePrintCPP);
bluePrintCPP.getGenerator().getCmakeConfig()
.addModuleDependency(new CMakeFindModule("OpenCV", true).asFindAsPackage());
bluePrintCPP.addAdditionalNameSpaceStrings("std");
ConversionHelper.setUsedCV();
}
......
......@@ -5,13 +5,14 @@ import de.monticore.lang.math._symboltable.matrix.MathMatrixAccessSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cmake.CMakeFindModule;
import de.monticore.lang.monticar.generator.cpp.ConversionHelper;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.MathExpressionProperties;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......@@ -62,8 +63,8 @@ public class DilateCommand extends ArgumentNoReturnMathCommand{
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
bluePrintCPP.addCVIncludeString("opencv2/imgproc/imgproc");
bluePrintCPP.addCVIncludeString("ConvHelper");
bluePrintCPP.addAdditionalStandardIncludeStringWithHPP("opencv2/imgproc/imgproc");
bluePrintCPP.addAdditionalUserIncludeStrings("ConvHelper");
bluePrint.addMethod(dilateHelperMethod);
redefineArmaMat(bluePrintCPP);
redefineInit(bluePrintCPP);
......
......@@ -8,7 +8,7 @@ import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......
......@@ -9,7 +9,7 @@ import de.monticore.lang.monticar.generator.MathCommand;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......
......@@ -8,7 +8,7 @@ import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......
......@@ -5,13 +5,14 @@ import de.monticore.lang.math._symboltable.matrix.MathMatrixAccessSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cmake.CMakeFindModule;
import de.monticore.lang.monticar.generator.cpp.ConversionHelper;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.MathExpressionProperties;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......@@ -64,13 +65,14 @@ public class ErodeCommand extends ArgumentNoReturnMathCommand{
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
bluePrintCPP.addCVIncludeString("opencv2/imgproc/imgproc");
bluePrintCPP.addCVIncludeString("ConvHelper");
bluePrintCPP.addAdditionalStandardIncludeStringWithHPP("opencv2/imgproc/imgproc");
bluePrintCPP.addAdditionalUserIncludeStrings("ConvHelper");
bluePrint.addMethod(erodeHelperMethod);
redefineArmaMat(bluePrintCPP);
redefineInit(bluePrintCPP);
bluePrintCPP.getGenerator().getCmakeConfig()
.addModuleDependency(new CMakeFindModule("OpenCV", true).asFindAsPackage());
bluePrintCPP.addAdditionalNameSpaceStrings("std");
ConversionHelper.setUsedCV();
}
......
......@@ -5,13 +5,14 @@ import de.monticore.lang.math._symboltable.matrix.MathMatrixAccessSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cmake.CMakeFindModule;
import de.monticore.lang.monticar.generator.cpp.ConversionHelper;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.MathExpressionProperties;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......@@ -62,14 +63,15 @@ public class FindContoursCommand extends ArgumentNoReturnMathCommand{
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
bluePrintCPP.addCVIncludeString("opencv2/imgproc/imgproc");
bluePrintCPP.addCVIncludeString("ConvHelper");
bluePrintCPP.addCVIncludeString("vector");
bluePrintCPP.addAdditionalStandardIncludeStringWithHPP("opencv2/imgproc/imgproc");
bluePrintCPP.addAdditionalUserIncludeStrings("ConvHelper");
bluePrintCPP.addAdditionalStandardInclude("vector");
bluePrint.addMethod(findContoursHelperMethod);
redefineArmaMat(bluePrintCPP);
redefineInit(bluePrintCPP);
bluePrintCPP.getGenerator().getCmakeConfig()
.addModuleDependency(new CMakeFindModule("OpenCV", true).asFindAsPackage());
bluePrintCPP.addAdditionalNameSpaceStrings("std");
ConversionHelper.setUsedCV();
}
......
......@@ -5,13 +5,14 @@ import de.monticore.lang.math._symboltable.matrix.MathMatrixAccessSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cmake.CMakeFindModule;
import de.monticore.lang.monticar.generator.cpp.ConversionHelper;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.MathExpressionProperties;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......@@ -62,8 +63,8 @@ public class GaussianBlurCommand extends ArgumentNoReturnMathCommand{
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
bluePrintCPP.addCVIncludeString("opencv2/imgproc/imgproc");
bluePrintCPP.addCVIncludeString("ConvHelper");
bluePrintCPP.addAdditionalStandardIncludeStringWithHPP("opencv2/imgproc/imgproc");
bluePrintCPP.addAdditionalUserIncludeStrings("ConvHelper");
bluePrint.addMethod(gaussianBlurHelperMethod);
redefineArmaMat(bluePrintCPP);
redefineInit(bluePrintCPP);
......
......@@ -5,13 +5,14 @@ import de.monticore.lang.math._symboltable.matrix.MathMatrixAccessSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cmake.CMakeFindModule;
import de.monticore.lang.monticar.generator.cpp.ConversionHelper;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.MathExpressionProperties;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......@@ -62,13 +63,14 @@ public class InRangeCommand extends ArgumentNoReturnMathCommand{
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
bluePrintCPP.addCVIncludeString("opencv2/core/core");
bluePrintCPP.addCVIncludeString("ConvHelper");
bluePrintCPP.addAdditionalStandardIncludeStringWithHPP("opencv2/core/core");
bluePrintCPP.addAdditionalUserIncludeStrings("ConvHelper");
bluePrint.addMethod(inRangeHelperMethod);
redefineArmaMat(bluePrintCPP);
redefineInit(bluePrintCPP);
bluePrintCPP.getGenerator().getCmakeConfig()
.addModuleDependency(new CMakeFindModule("OpenCV", true).asFindAsPackage());
bluePrintCPP.addAdditionalNameSpaceStrings("std");
ConversionHelper.setUsedCV();
}
......
......@@ -5,11 +5,12 @@ import de.monticore.lang.math._symboltable.matrix.MathMatrixAccessSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cmake.CMakeFindModule;
import de.monticore.lang.monticar.generator.cpp.ConversionHelper;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import de.se_rwth.commons.logging.Log;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
......@@ -62,12 +63,13 @@ public class LargestContourCommand extends MathCommand {
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
bluePrintCPP.addCVIncludeString("opencv2/imgproc/imgproc");
bluePrintCPP.addAdditionalStandardIncludeStringWithHPP("opencv2/imgproc/imgproc");
bluePrint.addMethod(largestContourMethod);
redefineArmaMat(bluePrintCPP);
redefineInit(bluePrintCPP);
bluePrintCPP.getGenerator().getCmakeConfig()
.addModuleDependency(new CMakeFindModule("OpenCV", true).asFindAsPackage());
bluePrintCPP.addAdditionalNameSpaceStrings("std");
ConversionHelper.setUsedCV();
}
......
......@@ -11,7 +11,7 @@ import de.monticore.lang.monticar.generator.cpp.OctaveHelper;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import java.util.ArrayList;
import java.util.List;
......@@ -49,7 +49,7 @@ public class MathAbsCommand extends MathCommand {
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
((EMAMBluePrintCPP) bluePrint).addAdditionalIncludeString("octave/builtin-defun-decls");
((EMAMBluePrintCPP) bluePrint).addAdditionalUserIncludeStrings("octave/builtin-defun-decls");
}
......@@ -69,7 +69,7 @@ public class MathAbsCommand extends MathCommand {
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
//((EMAMBluePrintCPP) bluePrint).addAdditionalIncludeString("octave/builtin-defun-decls");
//((EMAMBluePrintCPP) bluePrint).addAdditionalUserIncludeStrings("octave/builtin-defun-decls");
//String name = bluePrint.getVariables().get(0).getNameTargetLanguageFormat();
......
......@@ -11,7 +11,7 @@ import de.monticore.lang.monticar.generator.cpp.OctaveHelper;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import java.util.ArrayList;
import java.util.List;
......@@ -50,7 +50,7 @@ public class MathAcosCommand extends MathCommand {
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
((EMAMBluePrintCPP) bluePrint).addAdditionalIncludeString("octave/builtin-defun-decls");
((EMAMBluePrintCPP) bluePrint).addAdditionalUserIncludeStrings("octave/builtin-defun-decls");
}
......
......@@ -11,7 +11,7 @@ import de.monticore.lang.monticar.generator.cpp.OctaveHelper;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import java.util.ArrayList;
import java.util.List;
......@@ -49,7 +49,7 @@ public class MathAcoshCommand extends MathCommand {
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
((EMAMBluePrintCPP) bluePrint).addAdditionalIncludeString("octave/builtin-defun-decls");
((EMAMBluePrintCPP) bluePrint).addAdditionalUserIncludeStrings("octave/builtin-defun-decls");
}
......
......@@ -11,7 +11,7 @@ import de.monticore.lang.monticar.generator.cpp.OctaveHelper;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import java.util.ArrayList;
import java.util.List;
......@@ -50,7 +50,7 @@ public class MathAsinCommand extends MathCommand {
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
((EMAMBluePrintCPP) bluePrint).addAdditionalIncludeString("octave/builtin-defun-decls");
((EMAMBluePrintCPP) bluePrint).addAdditionalUserIncludeStrings("octave/builtin-defun-decls");
}
......
......@@ -11,7 +11,7 @@ import de.monticore.lang.monticar.generator.cpp.OctaveHelper;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.math.symbols.MathStringExpression;
import java.util.ArrayList;
import java.util.List;
......@@ -49,7 +49,7 @@ public class MathAsinhCommand extends MathCommand {
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
((EMAMBluePrintCPP) bluePrint).addAdditionalIncludeString("octave/builtin-defun-decls");