D2d offscreen rendering finish up.
This commit is contained in:
parent
8c814ce89f
commit
c63138c455
32 changed files with 288 additions and 64 deletions
|
@ -11,6 +11,10 @@ list(APPEND publishing_HEADERS
|
|||
pdf/PdfWriter.h
|
||||
plotting/GraphPlotter.h
|
||||
plotting/SvgConverter.h
|
||||
latex/LatexDocument.h
|
||||
latex/LatexMathExpression.h
|
||||
latex/LatexSymbols.h
|
||||
DocumentConverter.h
|
||||
)
|
||||
|
||||
list(APPEND publishing_LIB_INCLUDES
|
||||
|
@ -24,6 +28,9 @@ list(APPEND publishing_LIB_INCLUDES
|
|||
pdf/PdfStream.cpp
|
||||
pdf/PdfXRefTable.cpp
|
||||
pdf/PdfWriter.cpp
|
||||
latex/LatexDocument.cpp
|
||||
latex/LatexMathExpression.cpp
|
||||
latex/LatexSymbols.cpp
|
||||
plotting/GraphPlotter.h
|
||||
plotting/SvgConverter.cpp
|
||||
DocumentConverter.cpp
|
||||
|
@ -35,6 +42,7 @@ target_include_directories(publishing PUBLIC
|
|||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pdf
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/plotting
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/latex
|
||||
)
|
||||
set_target_properties( publishing PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON )
|
||||
target_link_libraries( publishing PUBLIC core web graphics visual_elements)
|
||||
|
|
0
src/publishing/latex/LatexDocument.cpp
Normal file
0
src/publishing/latex/LatexDocument.cpp
Normal file
0
src/publishing/latex/LatexDocument.h
Normal file
0
src/publishing/latex/LatexDocument.h
Normal file
0
src/publishing/latex/LatexMathExpression.cpp
Normal file
0
src/publishing/latex/LatexMathExpression.cpp
Normal file
41
src/publishing/latex/LatexMathExpression.h
Normal file
41
src/publishing/latex/LatexMathExpression.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
#pragma once
|
||||
|
||||
#include "LatexSymbols.h"
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class LatexMathExpression
|
||||
{
|
||||
public:
|
||||
LatexMathExpression(const std::string& expression = {})
|
||||
: mRawExpression(expression)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void parse()
|
||||
{
|
||||
for (auto c : mRawExpression)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<LatexMathSymbol>& getSymbols() const
|
||||
{
|
||||
return mSymbols;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
unsigned mOpenTagCount{ 0 };
|
||||
|
||||
std::string mRawExpression;
|
||||
std::unique_ptr<LatexMathExpression> mSuperScriptExpr;
|
||||
std::unique_ptr<LatexMathExpression> mSubScriptExpr;
|
||||
std::unique_ptr<LatexMathExpression> mEnclosedExpr;
|
||||
|
||||
std::vector<LatexMathSymbol> mSymbols;
|
||||
};
|
0
src/publishing/latex/LatexSymbols.cpp
Normal file
0
src/publishing/latex/LatexSymbols.cpp
Normal file
26
src/publishing/latex/LatexSymbols.h
Normal file
26
src/publishing/latex/LatexSymbols.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <optional>
|
||||
|
||||
struct LatexMathSymbol
|
||||
{
|
||||
enum class Type
|
||||
{
|
||||
RAW,
|
||||
TAG,
|
||||
RELATIONAL,
|
||||
RELATIONAL_TAG,
|
||||
ENCLOSING,
|
||||
ENCLOSING_TAG
|
||||
};
|
||||
std::string mName;
|
||||
std::wstring mUnicode;
|
||||
};
|
||||
|
||||
class LatexSymbolLookup
|
||||
{
|
||||
public:
|
||||
std::unordered_map<std::string, LatexMathSymbol> mTags;
|
||||
};
|
|
@ -43,7 +43,7 @@ std::unique_ptr<SvgDocument> SvgConverter::convert(Scene* scene)
|
|||
count++;
|
||||
}
|
||||
svg_tri->setPoints(points);
|
||||
svg_tri->setFill(item->getColor());
|
||||
svg_tri->setFill(item->getFillColor());
|
||||
doc->getRoot()->addChild(std::move(svg_tri));
|
||||
|
||||
if (scene->shouldShowMeshOutline())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue