Skip to content
Snippets Groups Projects
Select Git revision
  • 0b598844c2a40a91fa80759bc62ed567d6bec701
  • master default protected
  • alphashapes
  • quadMeshingTools
  • cygwin_conv_path
  • macos_arm64
  • add-transfiniteautomatic-to-geo
  • patch_releases_4_10
  • HierarchicalHDiv
  • isuruf-master-patch-63355
  • hyperbolic
  • hexdom
  • hxt_update
  • jf
  • 1618-pythonocc-and-gmsh-api-integration
  • octreeSizeField
  • hexbl
  • alignIrregularVertices
  • getEdges
  • patch_releases_4_8
  • isuruf-master-patch-51992
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
  • gmsh_4_8_4
  • gmsh_4_8_3
  • gmsh_4_8_2
  • gmsh_4_8_1
  • gmsh_4_8_0
  • gmsh_4_7_1
  • gmsh_4_7_0
41 results

CommandLine.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    LineReferenceSpace.cpp 1.78 KiB
    #include <sstream>
    #include "LineReferenceSpace.h"
    
    using namespace std;
    
    LineReferenceSpace::LineReferenceSpace(void){
      // Vertex Definition //
      nVertex = 2;
    
      // Edge Definition //
      refEdgeNodeIdx.resize(1);    // One Edge per Line
      refEdgeNodeIdx[0].resize(2); // Two Nodes per Edge
    
      refEdgeNodeIdx[0][0] = 0;
      refEdgeNodeIdx[0][1] = 1;
    
      // Face Definition //
      refFaceNodeIdx.clear(); // No Face in Line
      parallelFaceId.clear(); // And no parallel Face
    
      init();
    }
    
    LineReferenceSpace::~LineReferenceSpace(void){
    }
    
    string LineReferenceSpace::toLatex(void) const{
      const size_t nRefSpace = refSpaceNodeId.size();
      stringstream stream;
    
      stream << "\\documentclass{article}" << endl << endl
    
             << "\\usepackage{longtable}"  << endl
             << "\\usepackage{tikz}"       << endl
             << "\\usetikzlibrary{arrows}" << endl << endl
    
             << "\\begin{document}"                                   << endl
             << "\\tikzstyle{vertex} = [circle, fill = black!25]"     << endl
             << "\\tikzstyle{line}   = [draw, thick, black, -latex']" << endl
             << endl
    
             << "\\begin{longtable}{c}" << endl << endl;
    
      for(size_t s = 0; s < nRefSpace; s++){
        stream << "\\begin{tikzpicture}" << endl
    
               << "\\node[vertex] (n0) at(0, 0) {$" << refSpaceNodeId[s][0] << "$};"
               << endl
               << "\\node[vertex] (n1) at(3, 0) {$" << refSpaceNodeId[s][1] << "$};"
               << endl
               << endl
    
               << "\\path[line]"
               << " (n" << orderedEdgeNodeIdx[s][0][0] << ")"
               << " -- "
               << " (n" << orderedEdgeNodeIdx[s][0][1] << ");"
               << endl
    
               << "\\end{tikzpicture} \\\\ \\\\" << endl << endl;
      }
    
      stream << "\\end{longtable}" << endl
             << "\\end{document}"  << endl;
    
      return stream.str();
    }