Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
11f13631
Commit
11f13631
authored
8 years ago
by
Pau Miquel
Committed by
Pere Mato
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added section creating notebooks
parent
6185b6ec
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
documentation/doxygen/filter.cxx
+19
-24
19 additions, 24 deletions
documentation/doxygen/filter.cxx
with
19 additions
and
24 deletions
documentation/doxygen/filter.cxx
+
19
−
24
View file @
11f13631
...
...
@@ -161,15 +161,13 @@ void FilterClass()
// Source file.
if
(
gSource
)
{
size_t
spos
=
0
;
while
(
fgets
(
gLine
,
255
,
f
))
{
gLineString
=
gLine
;
if
(
gInMacro
&&
gLineString
.
find
(
"End_Macro"
)
!=
string
::
npos
)
{
if
(
gLineString
.
find
(
"End_Macro"
)
!=
string
::
npos
)
{
ReplaceAll
(
gLineString
,
"End_Macro"
,
""
);
gImageSource
=
false
;
gInMacro
=
0
;
spos
=
0
;
if
(
m
)
{
fclose
(
m
);
m
=
0
;
...
...
@@ -182,7 +180,6 @@ void FilterClass()
}
if
(
gInMacro
)
{
if
(
spos
)
gLineString
=
gLineString
.
substr
(
spos
);
if
(
gInMacro
==
1
)
{
if
(
EndsWith
(
gLineString
,
".C
\n
"
)
||
(
gLineString
.
find
(
".C("
)
!=
string
::
npos
))
{
ExecuteMacro
();
...
...
@@ -214,27 +211,14 @@ void FilterClass()
}
}
if
(
gLineString
.
find
(
"Begin_Macro"
)
!=
string
::
npos
&&
gLineString
.
find
(
"End_Macro"
)
==
string
::
npos
)
{
if
(
BeginsWith
(
gLineString
,
"///"
))
{
spos
=
gLineString
.
find_first_not_of
(
' '
,
3
);
}
if
(
gLineString
.
find
(
"Begin_Macro"
)
!=
string
::
npos
)
{
if
(
gLineString
.
find
(
"source"
)
!=
string
::
npos
)
gImageSource
=
true
;
gImageID
++
;
gInMacro
++
;
gLineString
=
"
\n
"
;
}
size_t
l
=
gLineString
.
length
();
size_t
b
=
0
;
do
{
size_t
e
=
gLineString
.
find
(
'\n'
,
b
);
if
(
e
!=
string
::
npos
)
e
++
;
if
(
spos
)
printf
(
"%-*s%s"
,
(
int
)
spos
,
"///"
,
gLineString
.
substr
(
b
,
e
-
b
).
c_str
());
else
printf
(
"%s"
,
gLineString
.
substr
(
b
,
e
-
b
).
c_str
());
b
=
e
;
}
while
(
b
<
l
);
printf
(
"%s"
,
gLineString
.
c_str
());
}
fclose
(
f
);
return
;
...
...
@@ -298,6 +282,12 @@ void FilterTutorial()
m
=
fopen
(
StringFormat
(
"%s/macros/%s"
,
gOutDir
.
c_str
(),
gMacroName
.
c_str
()).
c_str
(),
"w"
);
ReplaceAll
(
gLineString
,
"
\\
macro_code"
,
StringFormat
(
"
\\
include %s"
,
gMacroName
.
c_str
()));
}
// notebook found
if
(
gLineString
.
find
(
"
\\
notebook"
)
!=
string
::
npos
)
{
ExecuteCommand
(
StringFormat
(
"python converttonotebook.py %s %s/notebooks/"
,
gFileName
.
c_str
(),
gOutDir
.
c_str
()));
}
// \macro_output found
if
(
gLineString
.
find
(
"
\\
macro_output"
)
!=
string
::
npos
)
{
...
...
@@ -353,8 +343,7 @@ void GetClassName()
if
(
gSource
)
{
while
(
fgets
(
gLine
,
255
,
f
))
{
gLineString
=
gLine
;
if
(
gLineString
.
find
(
"ClassImp"
)
!=
string
::
npos
||
gLineString
.
find
(
"NamespaceImp"
)
!=
string
::
npos
)
{
if
(
gLineString
.
find
(
"ClassImp"
)
!=
string
::
npos
)
{
i1
=
gLineString
.
find
(
"("
)
+
1
;
i2
=
gLineString
.
find
(
")"
)
-
1
;
gClassName
=
gLineString
.
substr
(
i1
,
i2
-
i1
+
1
);
...
...
@@ -386,8 +375,12 @@ void ExecuteMacro()
gMacroName
=
gLineString
.
substr
(
i1
,
i2
-
i1
+
1
);
// Build the ROOT command to be executed.
bool
ts
=
false
;
if
(
BeginsWith
(
gLineString
,
"///"
))
ts
=
true
;
if
(
ts
)
ReplaceAll
(
gLineString
,
"///"
,
""
);
if
(
ts
)
ReplaceAll
(
gLineString
,
" "
,
""
);
gLineString
.
insert
(
0
,
StringFormat
(
"root -l -b -q
\"
makeimage.C(
\\\"
"
));
size_
t
l
=
gLineString
.
length
();
in
t
l
=
gLineString
.
length
();
gLineString
.
replace
(
l
-
1
,
1
,
StringFormat
(
"
\\\"
,
\\\"
%s
\\\"
,
\\\"
%s
\\\"
,true,false)
\"
"
,
gImageName
.
c_str
(),
gOutDir
.
c_str
()));
// Execute the macro
...
...
@@ -395,9 +388,11 @@ void ExecuteMacro()
// Inline the directives to show the picture and/or the code
if
(
gImageSource
)
{
gLineString
=
StringFormat
(
"
\\
include %s
\n\\
image html pict1_%s
\n
"
,
gMacroName
.
c_str
(),
gImageName
.
c_str
());
if
(
ts
)
gLineString
=
StringFormat
(
"///
\\
include %s
\n
///
\\
image html pict1_%s
\n
"
,
gMacroName
.
c_str
(),
gImageName
.
c_str
());
else
gLineString
=
StringFormat
(
"
\\
include %s
\n\\
image html pict1_%s
\n
"
,
gMacroName
.
c_str
(),
gImageName
.
c_str
());
}
else
{
gLineString
=
StringFormat
(
"
\n\\
image html pict1_%s
\n
"
,
gImageName
.
c_str
());
if
(
ts
)
gLineString
=
StringFormat
(
"
\n
///
\\
image html pict1_%s
\n
"
,
gImageName
.
c_str
());
else
gLineString
=
StringFormat
(
"
\n\\
image html pict1_%s
\n
"
,
gImageName
.
c_str
());
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment