Skip to content
Snippets Groups Projects
Commit 1535aac0 authored by Udo Eisenbarth's avatar Udo Eisenbarth :speech_balloon:
Browse files

Various doc work

parent 4bf5c2fc
No related branches found
No related tags found
1 merge request!5Resolve "Implement "inverted" feature for group nodes"
Pipeline #7364 passed with warnings
#![warn(missing_docs)]
use std::collections::HashMap;
use crate::{
......
#![warn(missing_docs)]
use crate::lightdata::LightData;
use crate::{
error::OpossumError,
......
#![warn(missing_docs)]
use std::collections::HashMap;
use crate::analyzer::AnalyzerType;
......
#![warn(missing_docs)]
use crate::lightdata::LightData;
use crate::{
error::OpossumError,
......@@ -16,7 +17,7 @@ pub enum Metertype {
/// an ideal energy meter
#[default]
IdealEnergyMeter,
/// an ideal power meter
/// an ideal power meter (currently not used)
IdealPowerMeter,
}
#[derive(Default)]
......
......@@ -349,10 +349,7 @@ impl NodeGroup {
self.incoming_edges(idx)
};
let node = self.g.node_weight(idx).unwrap();
// println!("Analyzing node {}", node.borrow().name());
// println!("Incoming edges {:?}", incoming_edges);
let outgoing_edges = node.borrow_mut().analyze(incoming_edges, analyzer_type)?;
// println!("Outgoing edges: {:?}", outgoing_edges);
let mut group_sinks = self.g.externals(Direction::Outgoing);
// Check if node is group sink node
if group_sinks.any(|gs| gs == idx) {
......
#![warn(missing_docs)]
use std::collections::HashMap;
use std::fmt::Debug;
......@@ -12,7 +13,7 @@ type Result<T> = std::result::Result<T, OpossumError>;
/// This node represents a source of light.
///
/// Hence it has only one output port (out1) and no input ports. Source nodes usually are the first nodes of an optic scenery.
/// Hence it has only one output port (out1) and no input ports. Source nodes usually are the first nodes of an [`OpticScenery`](crate::OpticScenery).
///
/// ## Optical Ports
/// - Inputs
......@@ -26,6 +27,19 @@ pub struct Source {
impl Source {
/// Creates a new [`Source`].
///
/// The light to be emitted from this source is defined in a [`LightData`] structure.
///
/// ## Example
///
/// ```rust
/// use opossum::{
/// lightdata::{DataEnergy, LightData},
/// nodes::Source,
/// spectrum::create_he_ne_spectrum};
///
/// let source=Source::new(LightData::Energy(DataEnergy {spectrum: create_he_ne_spectrum(1.0)}));
/// ```
pub fn new(light: LightData) -> Self {
Source {
light_data: Some(light),
......
#![warn(missing_docs)]
use uom::si::length::nanometer;
use crate::lightdata::LightData;
......
......@@ -22,7 +22,7 @@ impl OpticNode {
///
/// # Examples
///
/// ```
/// ```rust
/// use opossum::optic_node::OpticNode;
/// use opossum::nodes::Dummy;
///
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment