BioDynaMo
v1.05.120-25dc9790
neuroscience
neuron_or_neurite.cc
Go to the documentation of this file.
1
// -----------------------------------------------------------------------------
2
//
3
// Copyright (C) 2021 CERN & University of Surrey for the benefit of the
4
// BioDynaMo collaboration. All Rights Reserved.
5
//
6
// Licensed under the Apache License, Version 2.0 (the "License");
7
// you may not use this file except in compliance with the License.
8
//
9
// See the LICENSE file distributed with this work for details.
10
// See the NOTICE file distributed with this work for additional information
11
// regarding copyright ownership.
12
//
13
// -----------------------------------------------------------------------------
14
15
#include "
neuroscience/neuron_or_neurite.h
"
16
#include "
neuroscience/neurite_element.h
"
17
#include "
neuroscience/neuron_soma.h
"
18
19
namespace
bdm
{
20
namespace
neuroscience {
21
22
NeuronOrNeurite::~NeuronOrNeurite
() =
default
;
23
24
AgentPointer<NeuronOrNeurite>
NeuronOrNeurite::GetNeuronOrNeuriteAgentPtr
()
25
const
{
26
if
(
auto
* neuron =
dynamic_cast<
const
NeuronSoma
*
>
(
this
)) {
27
return
neuron->template GetAgentPtr<NeuronOrNeurite>();
28
}
else
if
(
auto
* neurite =
dynamic_cast<
const
NeuriteElement
*
>
(
this
)) {
29
return
neurite->template GetAgentPtr<NeuronOrNeurite>();
30
}
31
assert(
false
&&
"This code should not be reached."
);
32
return
AgentPointer<NeuronOrNeurite>
();
33
}
34
35
StructureIdentifierSWC
NeuronOrNeurite::GetIdentifierSWC
()
const
{
36
if
(
IsNeuronSoma
()) {
37
return
StructureIdentifierSWC::kSoma
;
38
}
else
{
39
return
StructureIdentifierSWC::kApicalDendrite
;
40
}
41
};
42
43
bool
NeuronOrNeurite::IsNeuronSoma
()
const
{
44
return
dynamic_cast<
const
NeuronSoma
*
>
(
this
) !=
nullptr
;
45
}
46
47
bool
NeuronOrNeurite::IsNeuriteElement
()
const
{
48
return
dynamic_cast<
const
NeuriteElement
*
>
(
this
) !=
nullptr
;
49
}
50
51
}
// namespace neuroscience
52
}
// namespace bdm
bdm
Definition:
agent.cc:39
bdm::AgentPointer
Definition:
agent_pointer.h:58
bdm::neuroscience::NeuronOrNeurite::GetNeuronOrNeuriteAgentPtr
AgentPointer< NeuronOrNeurite > GetNeuronOrNeuriteAgentPtr() const
Definition:
neuron_or_neurite.cc:24
bdm::neuroscience::kApicalDendrite
@ kApicalDendrite
Definition:
neuron_or_neurite.h:37
neuron_or_neurite.h
neuron_soma.h
neurite_element.h
bdm::neuroscience::NeuronSoma
Definition:
neuron_soma.h:30
bdm::neuroscience::NeuronOrNeurite::~NeuronOrNeurite
virtual ~NeuronOrNeurite()
bdm::neuroscience::NeuronOrNeurite::IsNeuronSoma
bool IsNeuronSoma() const
Definition:
neuron_or_neurite.cc:43
bdm::neuroscience::NeuronOrNeurite::GetIdentifierSWC
virtual StructureIdentifierSWC GetIdentifierSWC() const
Returns the SWC classification of the object.
Definition:
neuron_or_neurite.cc:35
bdm::neuroscience::StructureIdentifierSWC
StructureIdentifierSWC
Definition:
neuron_or_neurite.h:32
bdm::neuroscience::NeuronOrNeurite::IsNeuriteElement
bool IsNeuriteElement() const
Definition:
neuron_or_neurite.cc:47
bdm::neuroscience::kSoma
@ kSoma
Definition:
neuron_or_neurite.h:34
bdm::neuroscience::NeuriteElement
Definition:
neurite_element.h:56
Generated by
1.8.17